From 1fe2c89f43490e8276b6af5ab72c0c5735883d40 Mon Sep 17 00:00:00 2001 From: Nandha22 Date: Tue, 31 Dec 2024 20:37:22 +0530 Subject: [PATCH] Cat info changes --- api/cat/holders.md | 64 +++++++------------ api/cat/info.md | 104 ++++++++++++++----------------- api/cat/price.md | 73 ++++++++++------------ api/cat/update.md | 149 ++++++++++++++++++++++++++++++--------------- apisidebars.js | 3 +- 5 files changed, 201 insertions(+), 192 deletions(-) diff --git a/api/cat/holders.md b/api/cat/holders.md index 39eb6e1b..254d8dc1 100644 --- a/api/cat/holders.md +++ b/api/cat/holders.md @@ -6,7 +6,7 @@ import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; import ApiCallExample from '@site/src/components/ApiCallExample'; -# Get CAT Holders +# Get Token Holders This endpoint allows you to fetch the list of holders for a specific CAT (Chia Asset Token). @@ -16,14 +16,14 @@ This endpoint allows you to fetch the list of holders for a specific CAT (Chia A ``` -GET https://api.spacescan.io/cat/holders/{asset_id} +GET https://api.spacescan.io/token/holders/{asset_id} ``` ``` -GET https://api-testnet11.spacescan.io/cat/holders/{asset_id} +GET https://api-testnet11.spacescan.io/token/holders/{asset_id} ``` @@ -35,6 +35,7 @@ GET https://api-testnet11.spacescan.io/cat/holders/{asset_id} |-----------|--------|-------------------------------------------------| | asset_id | string | The unique identifier 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. ::: @@ -43,7 +44,7 @@ Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacesc 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/cat/holders/{asset_id}" \ +curl -X GET "https://pro-api.spacescan.io/token/holders/{asset_id}" \ -H "x-api-key: YOUR_API_KEY" ``` ::: @@ -52,12 +53,12 @@ curl -X GET "https://pro-api.spacescan.io/cat/holders/{asset_id}" \ - + 🚀 Test API in Browser - + 🚀 Test API in Browser @@ -70,12 +71,12 @@ curl -X GET "https://pro-api.spacescan.io/cat/holders/{asset_id}" \ - curl -X GET "https://api.spacescan.io/cat/holders/6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589" + curl -X GET "https://api.spacescan.io/token/holders/8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365" - curl -X GET "https://api-testnet11.spacescan.io/cat/holders/6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589" + curl -X GET "https://api-testnet11.spacescan.io/token/holders/8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365" @@ -86,8 +87,8 @@ curl -X GET "https://pro-api.spacescan.io/cat/holders/{asset_id}" \ import requests - asset_id = "6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589" - url = f"https://api.spacescan.io/cat/holders/{asset_id}" + asset_id = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365" + url = f"https://api.spacescan.io/token/holders/{asset_id}" response = requests.get(url) data = response.json() @@ -98,8 +99,8 @@ curl -X GET "https://pro-api.spacescan.io/cat/holders/{asset_id}" \ import requests - asset_id = "6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589" - url = f"https://api-testnet11.spacescan.io/cat/holders/{asset_id}" + asset_id = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365" + url = f"https://api-testnet11.spacescan.io/token/holders/{asset_id}" response = requests.get(url) data = response.json() @@ -112,8 +113,8 @@ curl -X GET "https://pro-api.spacescan.io/cat/holders/{asset_id}" \ - const assetId = "6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589"; - const url = `https://api.spacescan.io/cat/holders/${assetId}`; + const assetId = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365"; + const url = `https://api.spacescan.io/token/holders/${assetId}`; fetch(url) .then(response => response.json()) @@ -123,8 +124,8 @@ curl -X GET "https://pro-api.spacescan.io/cat/holders/{asset_id}" \ - const assetId = "6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589"; - const url = `https://api-testnet11.spacescan.io/cat/holders/${assetId}`; + const assetId = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365"; + const url = `https://api-testnet11.spacescan.io/token/holders/${assetId}`; fetch(url) .then(response => response.json()) @@ -138,41 +139,22 @@ curl -X GET "https://pro-api.spacescan.io/cat/holders/{asset_id}" \ ### Response - - - - - - - - + ### Response Schema | Field | Type | Description | |------------------|---------|-------------------------------------------------------| | status | string | The status of the API request | -| holders | array | List of CAT holders | -| total_holders | number | Total number of unique holders | -| total_supply | string | Total supply of the CAT | +| tokens | array | List of CAT holders | +| next_cursor | number | Pagination cursor for the next page | +| total_count | string | Total holders count | #### Holder Object -Each holder in the `holders` array contains: +Each holder in the `tokens` array contains: | Field | Type | Description | |------------------|---------|-------------------------------------------------------| | address | string | The holder's address | -| balance | string | The amount of CAT tokens held | -| percentage | number | Percentage of total supply held by this address | -| last_updated | string | Timestamp of last balance update | - -### 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 +| amount | string | The amount of CAT tokens held | diff --git a/api/cat/info.md b/api/cat/info.md index a8dc7ab7..01587117 100644 --- a/api/cat/info.md +++ b/api/cat/info.md @@ -55,12 +55,12 @@ curl -X GET "https://pro-api.spacescan.io/token/info/{token_id}?include_price=tr - + 🚀 Test API in Browser - + 🚀 Test API in Browser @@ -75,10 +75,10 @@ curl -X GET "https://pro-api.spacescan.io/token/info/{token_id}?include_price=tr ```bash # Basic info -curl -X GET "https://api.spacescan.io/token/info/14b40962dfef81d954ac0d92b51ec21ce7acd8c62dd9fef9303aa51c615cb495" +curl -X GET "https://api.spacescan.io/token/info/8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365" # With price and supply info -curl -X GET "https://api.spacescan.io/token/info/14b40962dfef81d954ac0d92b51ec21ce7acd8c62dd9fef9303aa51c615cb495?include_price=true&include_supply=true¤cy=USD" +curl -X GET "https://api.spacescan.io/token/info/8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365?include_price=true&include_supply=true¤cy=USD" ``` @@ -89,7 +89,7 @@ curl -X GET "https://api.spacescan.io/token/info/14b40962dfef81d954ac0d92b51ec21 ```python import requests -token_id = "14b40962dfef81d954ac0d92b51ec21ce7acd8c62dd9fef9303aa51c615cb495" +token_id = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365" params = { "include_price": "true", "include_supply": "true", @@ -106,7 +106,7 @@ print(data) ```javascript -const tokenId = "14b40962dfef81d954ac0d92b51ec21ce7acd8c62dd9fef9303aa51c615cb495"; +const tokenId = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365"; const url = `https://api.spacescan.io/token/info/${tokenId}?include_price=true&include_supply=true¤cy=USD`; fetch(url) @@ -118,59 +118,47 @@ fetch(url) +### Response + + + ### Response Schema | Field | Type | Description | |-------|------|-------------| -| status | string | Success or failure status | -| info | object | Basic token information | -| info.asset_id | string | The unique identifier of the CAT | -| info.token_id | string | Token ID in tkn format | -| info.name | string | The name of the CAT | -| info.description | string | Description of the CAT | -| info.symbol | string | Trading symbol of the CAT | -| info.preview_url | string | URL to the CAT's logo image | -| info.tags | string | Category tags | -| info.twitter | string | Twitter profile URL (null if not set) | -| info.discord | string | Discord server URL (null if not set) | -| info.website | string | Official website URL (null if not set) | -| info.type | string | Token type (e.g., "CAT2") | -| price | object | Price information (if requested) | -| price.price_[currency] | number | Price in specified currency | -| price.price_xch | number | Price in XCH | -| supply | object | Supply information (if requested) | -| supply.total_supply | number | Total token supply | -| supply.burned | number | Number of tokens burned | -| supply.melted | number | Number of tokens melted | -| supply.circulating_supply | number | Current circulating supply | - -### Example Response - -```json -{ - "status": "success", - "info": { - "asset_id": "14b40962dfef81d954ac0d92b51ec21ce7acd8c62dd9fef9303aa51c615cb495", - "token_id": "tkn1zj6qjckla7qaj49vpkft28kzrnn6ekxx9hvla7fs82j3cc2ukj2ssa84km", - "name": "LLC Burn Token", - "description": "LLC Burn Token can only be acquired by burning a Little Lambo Coin...", - "symbol": "LLBT", - "preview_url": "https://assets.spacescan.io/cat/f5cd9dccc98c1fd4f32b599324b6dd938c793c0e50af7581195aee603277bad8.webp", - "tags": "meme", - "twitter": "https://twitter.com/LittleLamboCoin", - "discord": "https://discord.gg/Ew96DzCxc7", - "website": "https://littlelambocoin.com/llc-burn-token", - "type": "CAT2" - }, - "price": { - "price_usd": 0.02624364935709997, - "price_xch": 0.001225206519248 - }, - "supply": { - "total_supply": 1000000000, - "burned": 1, - "melted": 0, - "circulating_supply": 999999999 - } -} -``` \ No newline at end of file +| status | string | The status of the API request | +| info | object | Token information object | +| price | object | Price information object | +| supply | object | Supply information object | + +#### Info Object + +| Field | Type | Description | +|-------|------|-------------| +| asset_id | string | The unique identifier of the CAT | +| token_id | string | Token ID in tkn format | +| name | string | The name of the CAT | +| description | string | Description of the CAT | +| symbol | string | Trading symbol of the CAT | +| preview_url | string | URL to the CAT's logo image | +| tags | string | Category tags | +| twitter | string | Twitter profile URL (null if not set) | +| discord | string | Discord server URL (null if not set) | +| website | string | Official website URL (null if not set) | +| type | string | Token type (e.g., "CAT2") | + +#### Price Object (if requested) + +| Field | Type | Description | +|-------|------|-------------| +| [currency] | string | Price in specified currency (e.g., "usd": 0.02624364935709997) | +| xch | string | Price in XCH | + +#### Supply Object (if requested) + +| Field | Type | Description | +|-------|------|-------------| +| total_supply | number | Total token supply | +| burned | number | Number of tokens burned | +| melted | number | Number of tokens melted | +| circulating_supply | number | Current circulating supply | diff --git a/api/cat/price.md b/api/cat/price.md index b3bdf43a..04d57dd1 100644 --- a/api/cat/price.md +++ b/api/cat/price.md @@ -6,9 +6,9 @@ import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; import ApiCallExample from '@site/src/components/ApiCallExample'; -# Get CAT Price +# Get Token Price -This endpoint allows you to fetch real-time price information for Chia Asset Tokens (CATs) in various currencies. Track current market prices, exchange rates, and fiat valuations for any CAT in the Chia ecosystem. This data is essential for portfolio tracking, trading decisions, and financial applications built on the Chia blockchain. +This endpoint allows you to fetch real-time price information for Chia Asset Tokens (CAT) ### Endpoint @@ -16,14 +16,14 @@ This endpoint allows you to fetch real-time price information for Chia Asset Tok ``` -GET https://api.spacescan.io/cat/catprice/{asset_id}?currency={currency_code} +GET https://api.spacescan.io/token/price/{asset_id}?currency={currency_code} ``` ``` -GET https://api-testnet11.spacescan.io/cat/catprice/{asset_id}?currency={currency_code} +GET https://api-testnet11.spacescan.io/token/price/{asset_id}?currency={currency_code} ``` @@ -34,7 +34,7 @@ GET https://api-testnet11.spacescan.io/cat/catprice/{asset_id}?currency={currenc | Parameter | Type | Description | Required | |--------------|--------|-------------------------------------------------|----------| | asset_id | string | The unique identifier (TAIL hash) of the CAT | Yes | -| currency | string | Currency code (e.g., USD, EUR, INR, etc.) | No | +| currency | string | Currency code (e.g., USD, EUR, USD, etc.) | No | :::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. @@ -44,7 +44,7 @@ Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacesc 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/cat/catprice/{asset_id}?currency=INR" \ +curl -X GET "https://pro-api.spacescan.io/token/price/{asset_id}?currency=USD" \ -H "x-api-key: YOUR_API_KEY" ``` ::: @@ -53,12 +53,12 @@ curl -X GET "https://pro-api.spacescan.io/cat/catprice/{asset_id}?currency=INR" - + 🚀 Test API in Browser - + 🚀 Test API in Browser @@ -71,12 +71,12 @@ curl -X GET "https://pro-api.spacescan.io/cat/catprice/{asset_id}?currency=INR" - curl -X GET "https://api.spacescan.io/cat/catprice/db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20?currency=INR" + curl -X GET "https://api.spacescan.io/token/price/8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365?currency=USD" - curl -X GET "https://api-testnet11.spacescan.io/cat/catprice/db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20?currency=INR" + curl -X GET "https://api-testnet11.spacescan.io/token/price/8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365?currency=USD" @@ -87,9 +87,9 @@ curl -X GET "https://pro-api.spacescan.io/cat/catprice/{asset_id}?currency=INR" import requests - asset_id = "db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20" - currency = "INR" - url = f"https://api.spacescan.io/cat/catprice/{asset_id}?currency={currency}" + asset_id = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365" + currency = "USD" + url = f"https://api.spacescan.io/token/price/{asset_id}?currency={currency}" response = requests.get(url) data = response.json() @@ -100,9 +100,9 @@ curl -X GET "https://pro-api.spacescan.io/cat/catprice/{asset_id}?currency=INR" import requests - asset_id = "db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20" - currency = "INR" - url = f"https://api-testnet11.spacescan.io/cat/catprice/{asset_id}?currency={currency}" + asset_id = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365" + currency = "USD" + url = f"https://api-testnet11.spacescan.io/token/price/{asset_id}?currency={currency}" response = requests.get(url) data = response.json() @@ -115,9 +115,9 @@ curl -X GET "https://pro-api.spacescan.io/cat/catprice/{asset_id}?currency=INR" - const assetId = "db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20"; - const currency = "INR"; - const url = `https://api.spacescan.io/cat/catprice/${assetId}?currency=${currency}`; + const assetId = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365"; + const currency = "USD"; + const url = `https://api.spacescan.io/token/price/${assetId}?currency=${currency}`; fetch(url) .then(response => response.json()) @@ -127,9 +127,9 @@ curl -X GET "https://pro-api.spacescan.io/cat/catprice/{asset_id}?currency=INR" - const assetId = "db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20"; - const currency = "INR"; - const url = `https://api-testnet11.spacescan.io/cat/catprice/${assetId}?currency=${currency}`; + const assetId = "8c77de1427156b98fb15cce77d908f79bd69f6b4b8e3a60d8e051dac481b5365"; + const currency = "USD"; + const url = `https://api-testnet11.spacescan.io/token/price/${assetId}?currency=${currency}`; fetch(url) .then(response => response.json()) @@ -143,29 +143,18 @@ curl -X GET "https://pro-api.spacescan.io/cat/catprice/{asset_id}?currency=INR" ### Response - - - - - - - - + ### Response Schema | Field | Type | Description | |--------------|---------|-------------------------------------------------------| | status | string | The status of the API request | -| amount_price | number | Current price in the requested currency | -| xch_price | string | Current price in XCH | - -### Error Responses - -| HTTP Status Code | Meaning | -|------------------|-------------------------------------------------------------------------------------------| -| 400 | Bad Request -- Your request is invalid or unsupported currency. | -| 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 +| price | object | Price information for the CAT | + +#### Price Object (if requested) + +| Field | Type | Description | +|-------|------|-------------| +| [currency] | string | Price in specified currency (e.g., "usd": 0.02624364935709997) | +| xch | string | Price in XCH | diff --git a/api/cat/update.md b/api/cat/update.md index 801297f5..165053fa 100644 --- a/api/cat/update.md +++ b/api/cat/update.md @@ -1,12 +1,13 @@ --- sidebar_position: 6 --- + import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import CodeBlock from '@theme/CodeBlock'; import ApiCallExample from '@site/src/components/ApiCallExample'; -# Update CAT Information +# Update Token Information This endpoint allows CAT creators and authorized parties to update metadata for their Chia Asset Tokens (CATs). Maintain accurate and up-to-date token information including name, symbol, description, and branding assets. The endpoint requires cryptographic proof of ownership through Chia wallet signatures to ensure secure and authenticated updates. @@ -51,22 +52,27 @@ POST https://api-testnet11.spacescan.io/cat/info/updatecat The `image_data` field is optional and can be used to directly provide the image data in base64 format instead of using the `image_url` field. ::: - ### Parameters -| Parameter | Type | Description | -|--------------|--------|------------------------------------------------------------| -| pubkey | string | Public key used for signing | -| signature | string | BLS signature of the message | -| signing_mode | string | Signature scheme used (typically BLS) | -| message | string | Message that was signed | -| address | string | EVE coin puzzle hash/minter address | -| asset_id | string | The unique identifier (TAIL hash) of the CAT | -| asset_name | string | New name for the CAT | -| description | string | New description for the CAT | -| cat_symbol | string | New trading symbol for the CAT | -| image_url | string | New URL for the CAT's logo/image | -| image_data | string | Base 64 string for the CAT's logo/image | +| Parameter | Type | Required | Description | +| ------------- | ------ | -------- | ------------------------------------------------------------------------------ | +| pubkey | string | Yes | Public key used for signing | +| signature | string | Yes | BLS signature of the message | +| signing_mode | string | Yes | Signature scheme (BLS*SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG:CHIP-0002*) | +| message | string | Yes | Message that was signed ("Confirm Sign in to import Tokens from spacescan.io") | +| address | string | Yes | EVE coin puzzle hash/minter address | +| asset_id | string | Yes | The unique identifier (TAIL hash) of the CAT | +| asset_name | string | Yes | Name for the CAT | +| description | string | No | Description for the CAT | +| cat_symbol | string | Yes | Trading symbol for the CAT | +| image_url | string | No | URL for the CAT's logo/image | +| image_data | string | No | Base64 encoded image data | +| issuance_type | string | No | Type of issuance | +| tags | string | No | Category tags for the CAT | +| multiplier | string | No | Token multiplier | +| clvm | string | No | CLVM code | +| lisp | string | No | LISP code | +| extra | string | No | Additional information | :::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. @@ -74,17 +80,35 @@ Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacesc :::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 POST "https://pro-api.spacescan.io/cat/info/updatecat" \ + -H "x-api-key: YOUR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"asset_id": "YOUR_ASSET_ID", ...}' +``` + ::: -### Request Example +### Request Examples - - curl -X POST "https://api.spacescan.io/cat/info/updatecat" \ - -H "Content-Type: application/json" \ - -d "@request.json" - + + curl -X POST "https://api.spacescan.io/cat/info/updatecat" \ + -H "Content-Type: application/json" \ + -d { + "pubkey": "YOUR_PUBLIC_KEY", + "signature": "YOUR_SIGNATURE", + "signing_mode": "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG:CHIP-0002_", + "message": "Confirm Sign in to import Tokens from spacescan.io", + "address": "YOUR_ADDRESS", + "asset_id": "YOUR_ASSET_ID", + "asset_name": "Your CAT Name", + "cat_symbol": "SYMBOL", + "description": "Your description" + } + @@ -93,54 +117,81 @@ Use `pro-api.spacescan.io` with your API key in the `x-api-key` header. See our url = "https://api.spacescan.io/cat/info/updatecat" - with open('request.json') as f: - data = json.load(f) - - response = requests.post(url, headers=headers, json=data) + data = { + "pubkey": "YOUR_PUBLIC_KEY", + "signature": "YOUR_SIGNATURE", + "signing_mode": "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG:CHIP-0002_", + "message": "Confirm Sign in to import Tokens from spacescan.io", + "address": "YOUR_ADDRESS", + "asset_id": "YOUR_ASSET_ID", + "asset_name": "Your CAT Name", + "cat_symbol": "SYMBOL", + "description": "Your description" + } + response = requests.post(url, json=data) print(response.json()) + - const fs = require('fs'); const url = "https://api.spacescan.io/cat/info/updatecat"; - const headers = { "Content-Type": "application/json"}; - - const data = JSON.parse(fs.readFileSync('request.json')); - - fetch(url, { - method: "POST", - headers: headers, + + const data = { + "pubkey": "YOUR_PUBLIC_KEY", + "signature": "YOUR_SIGNATURE", + "signing_mode": "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG:CHIP-0002_", + "message": "Confirm Sign in to import Tokens from spacescan.io", + "address": "YOUR_ADDRESS", + "asset_id": "YOUR_ASSET_ID", + "asset_name": "Your CAT Name", + "cat_symbol": "SYMBOL", + "description": "Your description" + } + + fetch(url, { + method: 'POST', + headers: {'Content-Type': 'application/json'}, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) - .catch(error => console.error("Error:", error)); + .catch(error => console.error('Error:', error)); + ### Response Schema -| Field | Type | Description | -|---------|---------|------------------------------------------------| -| status | string | The status of the API request | -| message | string | Success or error message | +| Field | Type | Description | +| ----- | ------ | -------------------- | ----------------------------- | --- | +| | +| data | object | Response data object | + +#### Data Object + +| Field | Type | Description | +| ------- | ------- | ------------------------------------------------ | +| claimed | boolean | Whether the update was successful | +| message | string | Additional information about the update (if any) | -### Error Responses +### Example Response -| HTTP Status Code | Meaning | -|------------------|-------------------------------------------------------------------------------------------| -| 400 | Bad Request -- Invalid request body or signature | -| 401 | Unauthorized -- Invalid signature or address doesn't match CAT minter | -| 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 | +```json +{ + "status": "success", + "data": { + "claimed": true + } +} +``` -### Notes +### Important Notes - The signature must be generated using the Chia wallet - The address must match the EVE coin puzzle hash or minter address of the CAT - The message must be exactly "Confirm Sign in to import Tokens from spacescan.io" -- Image URLs should be publicly accessible and contain appropriate image formats (PNG, JPG, etc.) \ No newline at end of file +- Image URLs should be publicly accessible and contain appropriate image formats (PNG, JPG, etc.) +- Base64 image data can be provided instead of image URL +- Updates are limited to 5 times per CAT owner diff --git a/apisidebars.js b/apisidebars.js index 520ae6f9..04a46635 100644 --- a/apisidebars.js +++ b/apisidebars.js @@ -33,12 +33,11 @@ const sidebars = { { type: 'category', - label: 'CAT', + label: 'Token', items: [ 'cat/info', 'cat/holders', 'cat/list', - 'cat/transactions', 'cat/price', 'cat/update', 'cat/total-supply',