-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from spacescan-io/sabari
Added cat circulating and total supply
- Loading branch information
Showing
3 changed files
with
330 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
|
||
``` | ||
GET https://api.spacescan.io/token/circulating-supply/{asset_id} | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
|
||
``` | ||
GET https://api-testnet11.spacescan.io/token/circulating-supply/{asset_id} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### 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 | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<a href="https://api.spacescan.io/token/circulating-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" target="_blank" rel="noopener noreferrer" className="api-test-button"> | ||
🚀 Test API in Browser | ||
</a> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<a href="https://api-testnet11.spacescan.io/token/circulating-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" target="_blank" rel="noopener noreferrer" className="api-test-button"> | ||
🚀 Test API in Browser | ||
</a> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Request Example | ||
|
||
<Tabs> | ||
<TabItem value="curl" label="cURL"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="bash"> | ||
curl -X GET "https://api.spacescan.io/token/circulating-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="bash"> | ||
curl -X GET "https://api-testnet11.spacescan.io/token/circulating-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
<TabItem value="python" label="Python"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="python"> | ||
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) | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="python"> | ||
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) | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
<TabItem value="javascript" label="JavaScript"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="javascript"> | ||
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)); | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="javascript"> | ||
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)); | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Response | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<ApiCallExample endpoint="https://api.spacescan.io/token/circulating-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" /> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<ApiCallExample endpoint="https://api-testnet11.spacescan.io/token/circulating-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" /> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
|
||
``` | ||
GET https://api.spacescan.io/token/total-supply/{asset_id} | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
|
||
``` | ||
GET https://api-testnet11.spacescan.io/token/total-supply/{asset_id} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### 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 | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<a href="https://api.spacescan.io/token/total-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" target="_blank" rel="noopener noreferrer" className="api-test-button"> | ||
🚀 Test API in Browser | ||
</a> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<a href="https://api-testnet11.spacescan.io/token/total-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" target="_blank" rel="noopener noreferrer" className="api-test-button"> | ||
🚀 Test API in Browser | ||
</a> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Request Example | ||
|
||
<Tabs> | ||
<TabItem value="curl" label="cURL"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="bash"> | ||
curl -X GET "https://api.spacescan.io/token/total-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="bash"> | ||
curl -X GET "https://api-testnet11.spacescan.io/token/total-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
<TabItem value="python" label="Python"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="python"> | ||
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) | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="python"> | ||
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) | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
<TabItem value="javascript" label="JavaScript"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="javascript"> | ||
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)); | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="javascript"> | ||
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)); | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Response | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<ApiCallExample endpoint="https://api.spacescan.io/token/total-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" /> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<ApiCallExample endpoint="https://api-testnet11.spacescan.io/token/total-supply/b8edcc6a7cf3738a3806fdbadb1bbcfc2540ec37f6732ab3a6a4bbcd2dbec105" /> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters