From b09fa1e2d8d43040a0f0add0438a37fec1de8ff2 Mon Sep 17 00:00:00 2001 From: NatSabari Date: Wed, 30 Oct 2024 01:44:55 -0400 Subject: [PATCH] Added cat circulating and total supply --- api/cat/circulating-supply.md | 164 ++++++++++++++++++++++++++++++++++ api/cat/total-supply.md | 164 ++++++++++++++++++++++++++++++++++ apisidebars.js | 2 + 3 files changed, 330 insertions(+) create mode 100644 api/cat/circulating-supply.md create mode 100644 api/cat/total-supply.md diff --git a/api/cat/circulating-supply.md b/api/cat/circulating-supply.md new file mode 100644 index 00000000..336e1617 --- /dev/null +++ b/api/cat/circulating-supply.md @@ -0,0 +1,164 @@ +--- +sidebar_position: 8 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import CodeBlock from '@theme/CodeBlock'; +import ApiCallExample from '@site/src/components/ApiCallExample'; + +# Get CAT Circulating Supply + +This endpoint allows you to fetch the current circulating supply of a Chia Asset Token (CAT). Monitor the actual number of tokens actively circulating in the market, excluding locked, reserved, or unvested tokens. This data is essential for accurate market cap calculations, liquidity analysis, and understanding the true market dynamics of CAT tokens. + +### Endpoint + + + + +``` +GET https://api.spacescan.io/token/circulating-supply/{asset_id} +``` + + + + +``` +GET https://api-testnet11.spacescan.io/token/circulating-supply/{asset_id} +``` + + + + +### Parameters + +| Parameter | Type | Description | +|-----------|--------|-------------------------------------------------| +| asset_id | string | The unique identifier (TAIL hash) of the CAT | + +:::info Free API +Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacescan.io/apis#plans) for rate limits and features. +::: + +:::tip Pro API +Use `pro-api.spacescan.io` with your API key in the `x-api-key` header. See our [API Plans](https://spacescan.io/apis#plans) for details. + +```bash +curl -X GET "https://pro-api.spacescan.io/token/circulating-supply/{asset_id}" \ + -H "x-api-key: YOUR_API_KEY" +``` +::: + +### Live API Test + + + + + 🚀 Test API in Browser + + + + + 🚀 Test API in Browser + + + + +### Request Example + + + + + + + curl -X GET "https://api.spacescan.io/token/circulating-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" + + + + + curl -X GET "https://api-testnet11.spacescan.io/token/circulating-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" + + + + + + + + + import requests + + asset_id = "b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" + url = f"https://api.spacescan.io/token/circulating-supply/{asset_id}" + + response = requests.get(url) + data = response.json() + print(data) + + + + + import requests + + asset_id = "b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" + url = f"https://api-testnet11.spacescan.io/token/circulating-supply/{asset_id}" + + response = requests.get(url) + data = response.json() + print(data) + + + + + + + + + const assetId = "b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105"; + const url = `https://api.spacescan.io/token/circulating-supply/${assetId}`; + + fetch(url) + .then(response => response.json()) + .then(data => console.log(data)) + .catch(error => console.error('Error:', error)); + + + + + const assetId = "b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105"; + const url = `https://api-testnet11.spacescan.io/token/circulating-supply/${assetId}`; + + fetch(url) + .then(response => response.json()) + .then(data => console.log(data)) + .catch(error => console.error('Error:', error)); + + + + + + +### Response + + + + + + + + + + +### Response Schema + +| Field | Type | Description | +|--------------------|---------|-------------------------------------------------------| +| circulating_supply | number | The current circulating supply of the CAT token | + +### Error Responses + +| HTTP Status Code | Meaning | +|------------------|-------------------------------------------------------------------------------------------| +| 400 | Bad Request -- Your request is invalid | +| 404 | Not Found -- The specified CAT could not be found | +| 429 | Too Many Requests -- You're requesting too many times! Slow down! | +| 500 | Internal Server Error -- We had a problem with our server. Try again later | +| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later | \ No newline at end of file diff --git a/api/cat/total-supply.md b/api/cat/total-supply.md new file mode 100644 index 00000000..38873b63 --- /dev/null +++ b/api/cat/total-supply.md @@ -0,0 +1,164 @@ +--- +sidebar_position: 7 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import CodeBlock from '@theme/CodeBlock'; +import ApiCallExample from '@site/src/components/ApiCallExample'; + +# Get CAT Total Supply + +This endpoint allows you to fetch the total supply of a Chia Asset Token (CAT). Track the maximum available tokens for any CAT in the Chia ecosystem. This information is crucial for understanding token economics, market capitalization calculations, and overall token distribution metrics. + +### Endpoint + + + + +``` +GET https://api.spacescan.io/token/total-supply/{asset_id} +``` + + + + +``` +GET https://api-testnet11.spacescan.io/token/total-supply/{asset_id} +``` + + + + +### Parameters + +| Parameter | Type | Description | +|-----------|--------|-------------------------------------------------| +| asset_id | string | The unique identifier (TAIL hash) of the CAT | + +:::info Free API +Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacescan.io/apis#plans) for rate limits and features. +::: + +:::tip Pro API +Use `pro-api.spacescan.io` with your API key in the `x-api-key` header. See our [API Plans](https://spacescan.io/apis#plans) for details. + +```bash +curl -X GET "https://pro-api.spacescan.io/token/total-supply/{asset_id}" \ + -H "x-api-key: YOUR_API_KEY" +``` +::: + +### Live API Test + + + + + 🚀 Test API in Browser + + + + + 🚀 Test API in Browser + + + + +### Request Example + + + + + + + curl -X GET "https://api.spacescan.io/token/total-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" + + + + + curl -X GET "https://api-testnet11.spacescan.io/token/total-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" + + + + + + + + + import requests + + asset_id = "b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" + url = f"https://api.spacescan.io/token/total-supply/{asset_id}" + + response = requests.get(url) + data = response.json() + print(data) + + + + + import requests + + asset_id = "b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" + url = f"https://api-testnet11.spacescan.io/token/total-supply/{asset_id}" + + response = requests.get(url) + data = response.json() + print(data) + + + + + + + + + const assetId = "b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105"; + const url = `https://api.spacescan.io/token/total-supply/${assetId}`; + + fetch(url) + .then(response => response.json()) + .then(data => console.log(data)) + .catch(error => console.error('Error:', error)); + + + + + const assetId = "b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105"; + const url = `https://api-testnet11.spacescan.io/token/total-supply/${assetId}`; + + fetch(url) + .then(response => response.json()) + .then(data => console.log(data)) + .catch(error => console.error('Error:', error)); + + + + + + +### Response + + + + + + + + + + +### Response Schema + +| Field | Type | Description | +|--------------|---------|--------------------------------------------------| +| total_supply | number | The total supply of the CAT token | + +### Error Responses + +| HTTP Status Code | Meaning | +|------------------|-------------------------------------------------------------------------------------------| +| 400 | Bad Request -- Your request is invalid | +| 404 | Not Found -- The specified CAT could not be found | +| 429 | Too Many Requests -- You're requesting too many times! Slow down! | +| 500 | Internal Server Error -- We had a problem with our server. Try again later | +| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later | \ No newline at end of file diff --git a/apisidebars.js b/apisidebars.js index e27da1bb..416a643b 100644 --- a/apisidebars.js +++ b/apisidebars.js @@ -38,6 +38,8 @@ const sidebars = { 'cat/transactions', 'cat/price', 'cat/update', + 'cat/total-supply', + 'cat/circulating-supply', ], },