From c5c563cb6dfd4b6aebe329219564a544e7fff05c Mon Sep 17 00:00:00 2001 From: rinchan01 Date: Wed, 27 Nov 2024 15:45:27 +0700 Subject: [PATCH 1/7] fix marketcap api to support old apis and update README.md --- README.md | 46 +++++++++++++ internal/checkTVL.ts | 2 +- internal/validateTokenFiles.ts | 16 +++-- ...d941baaf9bd748ebcdbf7adbb147273455247.yaml | 20 ------ ...27ee065c18df70a4a4cfc3093a41a4441584f.yaml | 18 ----- ...5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml | 21 ------ ...a1460841b74da6e7803820dde62bb78524a56.yaml | 16 ----- ...6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml | 20 ------ ...92a16002d1fb720e454fa6e993444794e5458.yaml | 20 ------ ...e800963589c41b38946602a0dc53541474958.yaml | 20 ------ package.json | 4 +- src/adapter.ts | 13 +--- src/apis/marketcapApi.ts | 46 +++++++++---- src/apis/tokenApi.ts | 18 ++--- src/const.ts | 7 +- src/test.ts | 69 +++++++++++++++++++ src/tokenSchema.ts | 46 ++++++------- ...d941baaf9bd748ebcdbf7adbb147273455247.yaml | 9 +++ ...af9bd748ebcdbf7adbb147273536967525356.yaml | 16 ----- ...27ee065c18df70a4a4cfc3093a41a4441584f.yaml | 5 ++ ...5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml | 5 ++ ...a1460841b74da6e7803820dde62bb78524a56.yaml | 5 +- ...6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml | 5 ++ ...92a16002d1fb720e454fa6e993444794e5458.yaml | 5 ++ ...e800963589c41b38946602a0dc53541474958.yaml | 7 +- src/types.ts | 4 +- src/utils.ts | 41 ++++++++--- test/utils.test.ts | 26 +++---- 28 files changed, 280 insertions(+), 250 deletions(-) delete mode 100644 need-update-apis/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247.yaml delete mode 100644 need-update-apis/420000029ad9527271b1b1e3c27ee065c18df70a4a4cfc3093a41a4441584f.yaml delete mode 100644 need-update-apis/6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml delete mode 100644 need-update-apis/8cfd6893f5f6c1cc954cec1a0a1460841b74da6e7803820dde62bb78524a56.yaml delete mode 100644 need-update-apis/ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml delete mode 100644 need-update-apis/edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458.yaml delete mode 100644 need-update-apis/f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958.yaml create mode 100644 src/test.ts delete mode 100644 src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273536967525356.yaml diff --git a/README.md b/README.md index 7f6e3c6..d1377fa 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,23 @@ # Minswap tokens + +## Overview + The merge of deprecated verified-tokens and market cap repositories, which contains a list of tokens, exposes APIs for transparent access to circulating supply and total supply. +As of latest update, we consider `circulating = maxSupply - treasury - burn` and `total = maxSupply - burn` as standard formulas for calculating marketcap information. + +In cases where `circulatingOnChain` is provided directly according to the asset's quantity on-chain or through external APIs, the `circulating` is the value of `circulatingOnChain`. + +For tokens providing with `treasuryNft`, the `circulating` is the quantity of the asset in the latest address containing it. + ## Requirements + For tokens to be verified, ensure your token has a pool with at least **1000 ADA TVL** and follow the structures stated in the instructions below. Any token that has been verified does not meet the requirements in the future would still be unverified. ## How to add my token + Create a pull request adding yaml file according to the following structure in the `src/tokens`: + ```yaml # 1 token = 1 yaml file # filename/assetId: policyId + hex-coded token name @@ -46,4 +58,38 @@ circulatingOnChain: - stake... - https://... - assetId + +treasuryNft: assetId +``` + +## Usage + +```ts +import { + BlockFrostAdapter, + MarketCapAPI, + TokenAPI, +} from "@minswap/minswap-tokens"; + +const MIN_TOKEN = + "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e"; + +// getting token info +const tokenApi = new TokenAPI(); + +const minTokenInfo = await tokenApi.getToken(MIN_TOKEN); + +console.log(minTokenInfo); + +// getting Market Cap info +const blockFrostAdapter = new BlockFrostAdapter({ + projectId: "", + requestTimeout: 20_000, +}); + +const marketCapApi = new MarketCapAPI(blockFrostAdapter); + +const minMarketCapInfo = await marketCapApi.getMarketCapInfo(minTokenInfo); +console.log(minMarketCapInfo); +// { circulating: '240813714.66121483', total: '5000000000' } ``` diff --git a/internal/checkTVL.ts b/internal/checkTVL.ts index 55ee575..a090390 100644 --- a/internal/checkTVL.ts +++ b/internal/checkTVL.ts @@ -39,7 +39,7 @@ async function verifyTVL() { for (const file of files) { const filePath = path.join(TOKEN_DIR, file); const tokenData = load(fs.readFileSync(filePath, "utf8")); - const tokenId = file.split('.')[0]; + const tokenId = file.split(".")[0]; const newVerified = await checkTVL(v1Pools, v2Pools, tokenId); if (newVerified === tokenData.verified) { continue; diff --git a/internal/validateTokenFiles.ts b/internal/validateTokenFiles.ts index 5d2f521..7fb99fd 100644 --- a/internal/validateTokenFiles.ts +++ b/internal/validateTokenFiles.ts @@ -1,11 +1,11 @@ -import Ajv from "ajv"; -import path from "node:path"; import * as fs from "node:fs"; +import path from "node:path"; +import Ajv from "ajv"; import { load } from "js-yaml"; -import { DEFAULT_TOKEN_DIR } from "@/const"; -import type { TokenMetadata } from "@/types"; +import { ASSET_ID_REGEX, DEFAULT_TOKEN_DIR } from "@/const"; import { tokenSchema } from "@/tokenSchema"; +import type { TokenMetadata } from "@/types"; const ajv = new Ajv(); const __dirname = import.meta.dirname; @@ -18,15 +18,19 @@ async function validateTokenFiles() { throw error; } for (const file of files) { + const fileName = file.split('.')[0]; + if (fileName.match(ASSET_ID_REGEX)) { + throw new Error(`Invalid filename: ${fileName}`); + } const filePath = path.join(TOKEN_DIR, `${file}`); const tokenFileData = fs.readFileSync(filePath, "utf-8"); const tokenData: TokenMetadata = { - tokenId: file.split('.')[0], + tokenId: file.split(".")[0], ...(load(tokenFileData) as Omit), }; const validate = ajv.validate(tokenSchema, tokenData); if (!validate) { - throw new Error(`Error validating token, token file: ${file}`); + throw new Error(`Validating failed token file: ${file}`); } } }); diff --git a/need-update-apis/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247.yaml b/need-update-apis/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247.yaml deleted file mode 100644 index 239e2ed..0000000 --- a/need-update-apis/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247.yaml +++ /dev/null @@ -1,20 +0,0 @@ -project: Rosen Bridge - -categories: - - Other - -socialLinks: - website: https://rosen.tech/ - twitter: https://twitter.com/RosenBridge_erg - discord: https://discord.com/invite/AHgsxhDKrQ - telegram: https://t.me/rosenbridge_erg - coinGecko: https://www.coingecko.com/en/coins/rosen-bridge - -verified: true - -decimals: 9 - -maxSupply: 97739924000000000 - -circulatingOnChain: - - https://api.ergoplatform.com/info/supply diff --git a/need-update-apis/420000029ad9527271b1b1e3c27ee065c18df70a4a4cfc3093a41a4441584f.yaml b/need-update-apis/420000029ad9527271b1b1e3c27ee065c18df70a4a4cfc3093a41a4441584f.yaml deleted file mode 100644 index f8e93ba..0000000 --- a/need-update-apis/420000029ad9527271b1b1e3c27ee065c18df70a4a4cfc3093a41a4441584f.yaml +++ /dev/null @@ -1,18 +0,0 @@ -project: Axo - -categories: - - DeFi - -socialLinks: - website: https://axo.trade - twitter: https://twitter.com/axotrade - discord: https://discord.com/invite/axotrade - -verified: true - -maxSupply: https://api.axo.trade/axo/total - -decimals: 9 - -circulatingOnChain: - - https://api.axo.trade/axo/circulating diff --git a/need-update-apis/6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml b/need-update-apis/6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml deleted file mode 100644 index 709037e..0000000 --- a/need-update-apis/6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml +++ /dev/null @@ -1,21 +0,0 @@ -project: MELD - -categories: - - RealFi - -socialLinks: - website: https://meld.com - discord: https://discord.gg/caDXKq75ys - twitter: https://twitter.com/MELD_Defi - telegram: https://t.me/MELD_Global - coinMarketCap: https://coinmarketcap.com/currencies/meld/ - coinGecko: https://www.coingecko.com/en/coins/meld - -verified: true - -maxSupply: 4000000000000000 - -decimals: 6 - -circulatingOnChain: - - https://app-backend.meld.com/api/market/meld/supply diff --git a/need-update-apis/8cfd6893f5f6c1cc954cec1a0a1460841b74da6e7803820dde62bb78524a56.yaml b/need-update-apis/8cfd6893f5f6c1cc954cec1a0a1460841b74da6e7803820dde62bb78524a56.yaml deleted file mode 100644 index daefbd9..0000000 --- a/need-update-apis/8cfd6893f5f6c1cc954cec1a0a1460841b74da6e7803820dde62bb78524a56.yaml +++ /dev/null @@ -1,16 +0,0 @@ -project: Rejuve - -categories: - - AI - -socialLinks: - website: https://rejuve.ai/ - -verified: true - -maxSupply: https://tokensupply.singularitynet.io/tokensupply?tokensymbol=rjv&q=totalsupply - -decimals: 0 - -circulatingOnChain: - - https://tokensupply.singularitynet.io/tokensupply?tokensymbol=rjv&q=circulatingsupply diff --git a/need-update-apis/ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml b/need-update-apis/ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml deleted file mode 100644 index f7f4c3d..0000000 --- a/need-update-apis/ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml +++ /dev/null @@ -1,20 +0,0 @@ -project: DEADPXLZ - -categories: - - NFT - -socialLinks: - website: https://pxlz.org - twitter: https://twitter.com/pxlzNFT - discord: https://discord.gg/PXLZ - coinMarketCap: https://coinmarketcap.com/currencies/deadpxlz/ - coinGecko: https://www.coingecko.com/en/coins/deadpxlz - -verified: true - -maxSupply: 1000000000000000 - -decimals: 6 - -circulatingOnChain: - - https://universe.pxlz.org/circulating diff --git a/need-update-apis/edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458.yaml b/need-update-apis/edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458.yaml deleted file mode 100644 index 5b61ca9..0000000 --- a/need-update-apis/edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458.yaml +++ /dev/null @@ -1,20 +0,0 @@ -project: NuNet Utility Token - -categories: - - AI - -socialLinks: - website: https://nunet.io/ - twitter: https://twitter.com/nunet_global - telegram: https://t.me/NuNet_Community - coinMarketCap: https://coinmarketcap.com/currencies/nunet/ - coinGecko: https://www.coingecko.com/en/coins/nunet - -verified: true - -maxSupply: https://tokensupply.singularitynet.io/tokensupply?tokensymbol=ntx&q=totalsupply - -decimals: 6 - -circulatingOnChain: - - https://tokensupply.singularitynet.io/tokensupply?tokensymbol=ntx&q=circulatingsupply diff --git a/need-update-apis/f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958.yaml b/need-update-apis/f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958.yaml deleted file mode 100644 index 46070f7..0000000 --- a/need-update-apis/f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958.yaml +++ /dev/null @@ -1,20 +0,0 @@ -project: SingularityNet - -categories: - - AI - -socialLinks: - website: https://singularitynet.io/ - twitter: https://twitter.com/SingularityNET - discord: https://discord.com/invite/snet - coinMarketCap: https://coinmarketcap.com/currencies/singularitynet/ - coinGecko: https://www.coingecko.com/en/coins/singularitynet - -verified: true - -maxSupply: https://tokensupply.singularitynet.io/tokensupply?tokensymbol=agix&q=totalsupply - -decimals: 6 - -circulatingOnChain: - - https://tokensupply.singularitynet.io/tokensupply?tokensymbol=agix&q=circulatingsupply diff --git a/package.json b/package.json index 33bad04..7603de2 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,7 @@ "check-tvl": "tsx --env-file=.env ./internal/checkTVL.ts", "lint": "biome check --no-errors-on-unmatched --fix ." }, - "files": [ - "build" - ], + "files": ["build"], "exports": { ".": { "types": "./build/index.d.ts", diff --git a/src/adapter.ts b/src/adapter.ts index c35695b..f6b32b6 100644 --- a/src/adapter.ts +++ b/src/adapter.ts @@ -16,16 +16,12 @@ export interface Adapter { /** * Get the amount held in the address holding a specific asset by the asset's ID. - * After obtaining a list of addresses possessing a specific asset in descending order, - * this retrieve the amount associated with the first address returned. + * After obtaining a list of addresses possessing a specific asset in descending order, this retrieve the amount associated with the first address returned. * This function currently supports Shen and DJED. * @param tokenId The token's policy ID. * @param nftId The concatenation of token's policy ID and hex-coded token name. */ - getAmountInFirstAddressHoldingAsset( - tokenId: string, - nftId: string - ): Promise; + getAmountInFirstAddressHoldingAsset(tokenId: string, nftId: string): Promise; } export class BlockFrostAdapter implements Adapter { @@ -53,10 +49,7 @@ export class BlockFrostAdapter implements Adapter { return BigInt(assetInfo?.quantity); } - async getAmountInFirstAddressHoldingAsset( - tokenId: string, - nftId: string - ): Promise { + async getAmountInFirstAddressHoldingAsset(tokenId: string, nftId: string): Promise { const addresses = await this.blockFrost.assetsAddresses(nftId); return await this.getAmountInAddress(addresses[0]["address"], tokenId); } diff --git a/src/apis/marketcapApi.ts b/src/apis/marketcapApi.ts index 254e851..e13b2f8 100644 --- a/src/apis/marketcapApi.ts +++ b/src/apis/marketcapApi.ts @@ -1,12 +1,7 @@ +import { MarketCapNullResponse } from "@/const"; import type { Adapter } from "../adapter"; import type { MarketCapInfoResponse, TokenMetadata } from "../types"; -import { - formatNumber, - getAmountFromURL, - isAPIEndPoint, - isAddress, - isBigInt, -} from "../utils"; +import { formatNumber, getAmountFromURL, isAPIEndPoint, isAddress, isBigInt } from "../utils"; export class MarketCapAPI { private readonly adapter: Adapter; @@ -38,7 +33,10 @@ export class MarketCapAPI { maxSupply = [tokenInfo.maxSupply]; } - const total = await this.getAmountFromArray(tokenId, maxSupply); + const total = await this.getAmountFromArray(tokenId, maxSupply, decimals); + if (total === null) { + return MarketCapNullResponse; + } if ( !tokenInfo.circulatingOnChain && @@ -65,15 +63,25 @@ export class MarketCapAPI { } const [treasury, burn] = await Promise.all([ - this.getAmountFromArray(tokenId, tokenInfo.treasury ?? []), - this.getAmountFromArray(tokenId, tokenInfo.burn ?? []), + this.getAmountFromArray(tokenId, tokenInfo.treasury ?? [], decimals), + this.getAmountFromArray(tokenId, tokenInfo.burn ?? [], decimals), ]); + if (burn === null || treasury === null) { + return MarketCapNullResponse; + } + if (tokenInfo.circulatingOnChain) { const circulatingOnChain = await this.getAmountFromArray( tokenId, - tokenInfo.circulatingOnChain + tokenInfo.circulatingOnChain, + decimals ); + + if (circulatingOnChain === null) { + return MarketCapNullResponse; + } + return { total: formatNumber(total - burn, decimals), circulating: formatNumber(circulatingOnChain - treasury, decimals), @@ -88,8 +96,9 @@ export class MarketCapAPI { private async getAmountFromArray( token: string, - values: (string | number)[] - ): Promise { + values: (string | number)[], + decimals: number + ): Promise { const amounts = await Promise.all( values.map((value) => { if (isBigInt(value)) { @@ -99,11 +108,18 @@ export class MarketCapAPI { return this.adapter.getAmountInAddress(value.toString(), token); } if (isAPIEndPoint(value)) { - return getAmountFromURL(value.toString()); + return getAmountFromURL(value.toString(), decimals); } return this.adapter.getOnchainAmountOfAsset(value.toString()); }) ); - return amounts.reduce((sum, x) => sum + x, 0n); + let amount = 0n; + for (const value of amounts) { + if (value === null) { + return null; + } + amount += value; + } + return amount; } } diff --git a/src/apis/tokenApi.ts b/src/apis/tokenApi.ts index bff09b8..989dcb3 100644 --- a/src/apis/tokenApi.ts +++ b/src/apis/tokenApi.ts @@ -1,9 +1,9 @@ import { load } from "js-yaml"; +import fs from "node:fs"; +import path from "node:path"; import { DEFAULT_TOKEN_DIR } from "@/const"; import type { GetTokenOptions, TokenMetadata } from "@/types"; -import path from "node:path"; -import fs from "node:fs"; export class TokenAPI { /** @@ -14,10 +14,7 @@ export class TokenAPI { public async getToken(tokenId: string) { try { const __dirname = import.meta.dirname; - const filePath = path.join( - __dirname, - `${DEFAULT_TOKEN_DIR}/${tokenId}.yaml` - ); + const filePath = path.join(__dirname, `../${DEFAULT_TOKEN_DIR}/${tokenId}.yaml`); const tokenFileData = fs.readFileSync(filePath, "utf-8"); const tokenData: TokenMetadata = { tokenId, @@ -37,7 +34,7 @@ export class TokenAPI { */ public async getTokens(options?: GetTokenOptions) { const __dirname = import.meta.dirname; - const directory = path.join(__dirname, `${DEFAULT_TOKEN_DIR}`); + const directory = path.join(__dirname, `../${DEFAULT_TOKEN_DIR}`); const tokenList: TokenMetadata[] = []; const files = fs.readdirSync(directory); for (const file of files) { @@ -46,11 +43,8 @@ export class TokenAPI { if (!token) { continue; } - const matchedVerify = - !options?.verifiedOnly || (options?.verifiedOnly && token.verified); - const matchedMarketCap = - !options?.hasMarketCapOnly || - (options?.hasMarketCapOnly && !!token.maxSupply); + const matchedVerify = !options?.verifiedOnly || (options?.verifiedOnly && token.verified); + const matchedMarketCap = !options?.hasMarketCapOnly || (options?.hasMarketCapOnly && !!token.maxSupply); if (matchedVerify && matchedMarketCap) { tokenList.push(token); } diff --git a/src/const.ts b/src/const.ts index b013a44..cda4ef5 100644 --- a/src/const.ts +++ b/src/const.ts @@ -1,7 +1,10 @@ export const DEFAULT_TOKEN_DIR = "tokens"; export const DEFAULT_FETCH_TIMEOUT = 20_000; -export const URL_REGEX = "^https:\/\/.*$"; +export const URL_REGEX = "^https://.*$"; export const ADDRESS_REGEX = "^(addr|stake)[0-9a-zA-Z]+"; export const ASSET_ID_REGEX = "^(([a-fA-F0-9]{2}){28,})$"; - +export const MarketCapNullResponse = { + total: null, + circulating: null, +}; diff --git a/src/test.ts b/src/test.ts new file mode 100644 index 0000000..638c121 --- /dev/null +++ b/src/test.ts @@ -0,0 +1,69 @@ +import path from "node:path"; +import fs from "node:fs"; +import { BlockFrostAdapter } from "./adapter"; +import { MarketCapAPI } from "./apis/marketcapApi"; +import { TokenAPI } from "./apis/tokenApi"; +import type { TokenMetadata } from "./types"; +import { getBlockFrostInstance } from "./utils"; +import { load } from "js-yaml"; + +const blockFrostInstance = getBlockFrostInstance(); +const blockFrostAdapter = new BlockFrostAdapter(blockFrostInstance); +const tokenApi = new TokenAPI(); +const marketcapApi = new MarketCapAPI(blockFrostAdapter); + +async function getToken(tokenId: string) { + try { + const __dirname = import.meta.dirname; + const filePath = path.join( + __dirname, + `../need-update-apis/${tokenId}.yaml` + ); + const tokenFileData = fs.readFileSync(filePath, "utf-8"); + const tokenData: TokenMetadata = { + tokenId, + ...(load(tokenFileData) as Omit), + }; + return tokenData; + } catch (e) { + console.error(e); + return null; + } +} + +function moveFile(tokenFileName: string) { + const oldPath = `../need-update-apis/${tokenFileName}`; + const newPath = `./tokens/${tokenFileName}`; + fs.rename(oldPath, newPath, (err) => { + if (err) { + console.error("Could not move file", err); + } + }); +} + +async function test() { + const __dirname = import.meta.dirname; + const tokenFileDir = path.join(__dirname, "../need-update-apis"); + fs.readdir(tokenFileDir, async (error, files) => { + if (error) { + console.log(error); + } + for (const file of files) { + const tokenId = file.split(".")[0]; + const tokenInfo = await getToken(tokenId); + if ( + tokenInfo + ) { + console.log( + tokenInfo.tokenId.slice(0, 56), + tokenInfo.tokenId.slice(56) + ); + try { + const marketcapInfo = await marketcapApi.getMarketCapInfo(tokenInfo); + console.log(marketcapInfo); + } catch {} + } + } + }); +} +test(); diff --git a/src/tokenSchema.ts b/src/tokenSchema.ts index 78ba68b..b5fe6d8 100644 --- a/src/tokenSchema.ts +++ b/src/tokenSchema.ts @@ -1,12 +1,11 @@ import { Ajv, type JSONSchemaType } from "ajv"; +import { ADDRESS_REGEX, ASSET_ID_REGEX, URL_REGEX } from "./const"; import type { TokenMetadata } from "./types"; -import { ADDRESS_REGEX, URL_REGEX, ASSET_ID_REGEX } from "./const"; const ajv = new Ajv(); ajv.addKeyword("resource"); - export const tokenSchema: JSONSchemaType = { type: "object", properties: { @@ -89,28 +88,28 @@ export const tokenSchema: JSONSchemaType = { // }, // }, treasury: { - type: "array", - items: { - oneOf: [ - { - type: "string", - pattern: ADDRESS_REGEX, - }, - { - type: "string", - pattern: URL_REGEX, - }, - { - type: "string", - pattern: ASSET_ID_REGEX, - }, - { - type: "number", - }, - ], - }, - nullable: true, + type: "array", + items: { + oneOf: [ + { + type: "string", + pattern: ADDRESS_REGEX, + }, + { + type: "string", + pattern: URL_REGEX, + }, + { + type: "string", + pattern: ASSET_ID_REGEX, + }, + { + type: "number", + }, + ], }, + nullable: true, + }, burn: { type: "array", items: { @@ -165,4 +164,3 @@ export const tokenSchema: JSONSchemaType = { additionalProperties: false, required: ["tokenId", "project", "categories", "decimals", "verified"], }; - diff --git a/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247.yaml b/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247.yaml index 7bc1973..239e2ed 100644 --- a/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247.yaml +++ b/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247.yaml @@ -1,11 +1,20 @@ project: Rosen Bridge + categories: - Other + socialLinks: website: https://rosen.tech/ twitter: https://twitter.com/RosenBridge_erg discord: https://discord.com/invite/AHgsxhDKrQ telegram: https://t.me/rosenbridge_erg coinGecko: https://www.coingecko.com/en/coins/rosen-bridge + verified: true + decimals: 9 + +maxSupply: 97739924000000000 + +circulatingOnChain: + - https://api.ergoplatform.com/info/supply diff --git a/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273536967525356.yaml b/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273536967525356.yaml deleted file mode 100644 index 1372103..0000000 --- a/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273536967525356.yaml +++ /dev/null @@ -1,16 +0,0 @@ -project: Rosen Bridge - -categories: - - Other - -socialLinks: - website: https://rosen.tech/ - twitter: https://twitter.com/RosenBridge_erg - discord: https://discord.com/invite/AHgsxhDKrQ - telegram: https://t.me/rosenbridge_erg - coinGecko: https://www.coingecko.com/en/coins/rosen-bridge - -decimals: 0 - -verified: false - diff --git a/src/tokens/420000029ad9527271b1b1e3c27ee065c18df70a4a4cfc3093a41a4441584f.yaml b/src/tokens/420000029ad9527271b1b1e3c27ee065c18df70a4a4cfc3093a41a4441584f.yaml index 77a494c..f8e93ba 100644 --- a/src/tokens/420000029ad9527271b1b1e3c27ee065c18df70a4a4cfc3093a41a4441584f.yaml +++ b/src/tokens/420000029ad9527271b1b1e3c27ee065c18df70a4a4cfc3093a41a4441584f.yaml @@ -10,4 +10,9 @@ socialLinks: verified: true +maxSupply: https://api.axo.trade/axo/total + decimals: 9 + +circulatingOnChain: + - https://api.axo.trade/axo/circulating diff --git a/src/tokens/6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml b/src/tokens/6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml index cd7d421..709037e 100644 --- a/src/tokens/6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml +++ b/src/tokens/6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44.yaml @@ -13,4 +13,9 @@ socialLinks: verified: true +maxSupply: 4000000000000000 + decimals: 6 + +circulatingOnChain: + - https://app-backend.meld.com/api/market/meld/supply diff --git a/src/tokens/8cfd6893f5f6c1cc954cec1a0a1460841b74da6e7803820dde62bb78524a56.yaml b/src/tokens/8cfd6893f5f6c1cc954cec1a0a1460841b74da6e7803820dde62bb78524a56.yaml index 2fa1b05..5a1d996 100644 --- a/src/tokens/8cfd6893f5f6c1cc954cec1a0a1460841b74da6e7803820dde62bb78524a56.yaml +++ b/src/tokens/8cfd6893f5f6c1cc954cec1a0a1460841b74da6e7803820dde62bb78524a56.yaml @@ -8,6 +8,9 @@ socialLinks: verified: true +maxSupply: https://tokensupply.singularitynet.io/tokensupply?tokensymbol=rjv&q=totalsupply -decimals: 0 +decimals: 6 +circulatingOnChain: + - https://tokensupply.singularitynet.io/tokensupply?tokensymbol=rjv&q=circulatingsupply diff --git a/src/tokens/ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml b/src/tokens/ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml index 16be20f..f7f4c3d 100644 --- a/src/tokens/ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml +++ b/src/tokens/ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47.yaml @@ -12,4 +12,9 @@ socialLinks: verified: true +maxSupply: 1000000000000000 + decimals: 6 + +circulatingOnChain: + - https://universe.pxlz.org/circulating diff --git a/src/tokens/edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458.yaml b/src/tokens/edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458.yaml index 146d480..5b61ca9 100644 --- a/src/tokens/edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458.yaml +++ b/src/tokens/edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458.yaml @@ -12,4 +12,9 @@ socialLinks: verified: true +maxSupply: https://tokensupply.singularitynet.io/tokensupply?tokensymbol=ntx&q=totalsupply + decimals: 6 + +circulatingOnChain: + - https://tokensupply.singularitynet.io/tokensupply?tokensymbol=ntx&q=circulatingsupply diff --git a/src/tokens/f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958.yaml b/src/tokens/f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958.yaml index 659acfa..1014eff 100644 --- a/src/tokens/f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958.yaml +++ b/src/tokens/f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958.yaml @@ -12,4 +12,9 @@ socialLinks: verified: true -decimals: 6 +maxSupply: https://tokensupply.singularitynet.io/tokensupply?tokensymbol=agix&q=totalsupply + +decimals: 8 + +circulatingOnChain: + - https://tokensupply.singularitynet.io/tokensupply?tokensymbol=agix&q=circulatingsupply diff --git a/src/types.ts b/src/types.ts index d2eb192..ec9be79 100644 --- a/src/types.ts +++ b/src/types.ts @@ -59,8 +59,8 @@ export type GetTokenOptions = { }; export type MarketCapInfoResponse = { - total?: string; - circulating?: string; + total?: string | null; + circulating?: string | null; }; export type { TokenMetadata }; diff --git a/src/utils.ts b/src/utils.ts index aaea81a..5ca5015 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,9 @@ import { BlockFrostAPI } from "@blockfrost/blockfrost-js"; import { DefaultFetcherOptions } from "./types"; -export function getBlockFrostInstance(options = DefaultFetcherOptions): BlockFrostAPI { +export function getBlockFrostInstance( + options = DefaultFetcherOptions +): BlockFrostAPI { return new BlockFrostAPI({ projectId: process.env["BLOCKFROST_PROJECT_ID"] ?? "", requestTimeout: options.timeout, @@ -18,21 +20,26 @@ export function tryParseBigInt(value: string | number): bigint | null { export function formatNumber(value: bigint, decimals: number): string { if (value === 0n) { - return '0'; + return "0"; } const numberString = value.toString(); if (numberString.length <= decimals) { - return `0.${numberString.padStart(decimals, '0')}`; + return `0.${numberString.padStart(decimals, "0")}`; } - const postfix = numberString.slice(numberString.length - decimals).replace(/0+$/g, ""); + const postfix = numberString + .slice(numberString.length - decimals) + .replace(/0+$/g, ""); const decimalPoint = postfix.length ? "." : ""; const prefix = numberString.slice(0, numberString.length - decimals); return prefix + decimalPoint + postfix; } export function isBigInt(value: string | number): boolean { - return !Number.isNaN(Number(value)) && value.toString() === tryParseBigInt(value)?.toString(); + return ( + !Number.isNaN(Number(value)) && + value.toString() === tryParseBigInt(value)?.toString() + ); } export function isAPIEndPoint(str: string | number): boolean { @@ -40,11 +47,27 @@ export function isAPIEndPoint(str: string | number): boolean { } export function isAddress(str: string | number): boolean { - return typeof str === "string" && (str.startsWith("addr") || str.startsWith("stake")); + return ( + typeof str === "string" && + (str.startsWith("addr") || str.startsWith("stake")) + ); } -export async function getAmountFromURL(url: string): Promise { +export async function getAmountFromURL( + url: string, + decimals: number +): Promise { const response = await fetch(url); - const data = await response.text(); - return BigInt(data); + let data = await response.text(); + // + if (data.includes(".")) { + const [prefix, postfix] = data.split("."); + console.log({ prefix, postfix, decimals }); + if (postfix.length > decimals) { + return null; + } + data = prefix + postfix.padEnd(decimals, "0"); + } + + return tryParseBigInt(data); } diff --git a/test/utils.test.ts b/test/utils.test.ts index b1a6fc0..5a63e96 100644 --- a/test/utils.test.ts +++ b/test/utils.test.ts @@ -1,19 +1,19 @@ import { formatNumber, tryParseBigInt } from "../src/utils"; -describe('Utils functions tests', () => { - test('Should try parse bigint', () => { +describe("Utils functions tests", () => { + test("Should try parse bigint", () => { expect(tryParseBigInt(123456)).toBe(123456n); - expect(tryParseBigInt('1234567890')).toBe(1234567890n); - expect(tryParseBigInt('123456789n')).toBe(null); - expect(tryParseBigInt('123_456_789')).toBe(null); + expect(tryParseBigInt("1234567890")).toBe(1234567890n); + expect(tryParseBigInt("123456789n")).toBe(null); + expect(tryParseBigInt("123_456_789")).toBe(null); }); - test('Should format number', () => { - expect(formatNumber(BigInt(123456789123456789n), 5)).toEqual('1234567891234.56789'); - expect(formatNumber(BigInt(12345), 5)).toEqual('0.12345'); - expect(formatNumber(BigInt(1230003000), 5)).toEqual('12300.03'); - expect(formatNumber(BigInt(123), 5)).toEqual('0.00123'); + test("Should format number", () => { + expect(formatNumber(BigInt(123456789123456789n), 5)).toEqual("1234567891234.56789"); + expect(formatNumber(BigInt(12345), 5)).toEqual("0.12345"); + expect(formatNumber(BigInt(1230003000), 5)).toEqual("12300.03"); + expect(formatNumber(BigInt(123), 5)).toEqual("0.00123"); expect(formatNumber(123000n, 2)).toEqual("1230"); - expect(formatNumber(BigInt(0), 5)).toEqual('0'); - }) -}) + expect(formatNumber(BigInt(0), 5)).toEqual("0"); + }); +}); From 1e39f1bb1076a8c8defc668aa68b5c2d79414084 Mon Sep 17 00:00:00 2001 From: rinchan01 Date: Wed, 27 Nov 2024 16:57:37 +0700 Subject: [PATCH 2/7] refactor and update README.md --- README.md | 13 +++- internal/checkTVL.ts | 2 + internal/validateTokenFiles.ts | 4 +- src/apis/marketcapApi.ts | 12 ++-- src/apis/tokenApi.ts | 4 +- src/test.ts | 69 ------------------- src/tokenSchema.ts | 25 ------- ...3f55fdd79f390c7415e2a09b64797534e4f4b.yaml | 7 ++ ...d941baaf9bd748ebcdbf7adbb14727352534e.yaml | 6 ++ src/utils.ts | 32 +++------ 10 files changed, 45 insertions(+), 129 deletions(-) delete mode 100644 src/test.ts diff --git a/README.md b/README.md index d1377fa..f6a1f4d 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,19 @@ In cases where `circulatingOnChain` is provided directly according to the asset' For tokens providing with `treasuryNft`, the `circulating` is the quantity of the asset in the latest address containing it. ## Requirements +As token verification prerequisites, ensure your token has a pool with at least **1000 ADA TVL** and follow the structure stated in the instructions below. + +For tokens to be verified: +1. Create a transaction transfer **100 ADA** to Minswap wallet receiving token verification fee below. +2. Metadata includes: **the last 4 numbers of asset's policyId and asset's ticker**. +3. Attach the transaction hash to a comment in the yaml file pull request (instructions below). + + +Minswap wallet receiving token verification fee: `addr1q85g6fkwzr2cf984qdmntqthl3yxnw4pst4mpgeyygdlnehqlcgwvr6c9vmajz96vnmmset3earqt5wl0keg0kw60eysdgwnej` + +Any token that has been verified does not meet the requirements in the future would still be unverified. + -For tokens to be verified, ensure your token has a pool with at least **1000 ADA TVL** and follow the structures stated in the instructions below. Any token that has been verified does not meet the requirements in the future would still be unverified. ## How to add my token diff --git a/internal/checkTVL.ts b/internal/checkTVL.ts index 5c96cbb..b069309 100644 --- a/internal/checkTVL.ts +++ b/internal/checkTVL.ts @@ -60,6 +60,7 @@ async function verifyTVL() { } async function checkTVL(v1Pools: SDK.PoolV1.State[], v2Pools: SDK.PoolV2.State[], tokenId: string): Promise { + console.log(`Checking TVL for token ${tokenId}...`); if (STABLE_COINS.includes(tokenId)) { return true; } @@ -85,6 +86,7 @@ async function getAllV1Pools() { let page = 1; while (true) { + console.log(`Fetching V1 Pools on page: ${page}...`); const paginatedPools = await blockfrostAdapter.getV1Pools({ page, count: LIMIT_PAGINATION, diff --git a/internal/validateTokenFiles.ts b/internal/validateTokenFiles.ts index 33a886a..b3c544e 100644 --- a/internal/validateTokenFiles.ts +++ b/internal/validateTokenFiles.ts @@ -18,8 +18,8 @@ async function validateTokenFiles() { throw error; } for (const file of files) { - const fileName = file.split('.')[0]; - if (fileName.match(ASSET_ID_REGEX)) { + const fileName = file.split(".")[0]; + if (!fileName.match(ASSET_ID_REGEX)) { throw new Error(`Invalid filename: ${fileName}`); } const filePath = path.join(TOKEN_DIR, `${file}`); diff --git a/src/apis/marketcapApi.ts b/src/apis/marketcapApi.ts index ad92024..f357cc6 100644 --- a/src/apis/marketcapApi.ts +++ b/src/apis/marketcapApi.ts @@ -4,8 +4,8 @@ import { formatNumber, getAmountFromURL, isAPIEndPoint, isAddress, isBigInt } fr const nullResponse = { total: null, - circulating: null -} + circulating: null, +}; export class MarketCapAPI { private readonly adapter: Adapter; @@ -66,11 +66,7 @@ export class MarketCapAPI { } if (tokenInfo.circulatingOnChain) { - const circulatingOnChain = await this.getAmountFromArray( - tokenId, - tokenInfo.circulatingOnChain, - decimals - ); + const circulatingOnChain = await this.getAmountFromArray(tokenId, tokenInfo.circulatingOnChain, decimals); if (circulatingOnChain === null) { return nullResponse; @@ -91,7 +87,7 @@ export class MarketCapAPI { private async getAmountFromArray( token: string, values: (string | number)[], - decimals: number + decimals: number, ): Promise { const amounts = await Promise.all( values.map((value) => { diff --git a/src/apis/tokenApi.ts b/src/apis/tokenApi.ts index 7fcd6f6..9451960 100644 --- a/src/apis/tokenApi.ts +++ b/src/apis/tokenApi.ts @@ -14,7 +14,7 @@ export class TokenAPI { public async getToken(tokenId: string) { try { const __dirname = import.meta.dirname; - const filePath = path.join(__dirname, `${TOKENS_DIR}/${tokenId}.yaml`); + const filePath = path.join(__dirname, `../${TOKENS_DIR}/${tokenId}.yaml`); const tokenFileData = fs.readFileSync(filePath, "utf-8"); const tokenData: TokenMetadata = { tokenId, @@ -34,7 +34,7 @@ export class TokenAPI { */ public async getTokens(options?: GetTokenOptions) { const __dirname = import.meta.dirname; - const directory = path.join(__dirname, TOKENS_DIR); + const directory = path.join(__dirname, `../${TOKENS_DIR}`); const tokenList: TokenMetadata[] = []; const files = fs.readdirSync(directory); for (const file of files) { diff --git a/src/test.ts b/src/test.ts deleted file mode 100644 index 638c121..0000000 --- a/src/test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import path from "node:path"; -import fs from "node:fs"; -import { BlockFrostAdapter } from "./adapter"; -import { MarketCapAPI } from "./apis/marketcapApi"; -import { TokenAPI } from "./apis/tokenApi"; -import type { TokenMetadata } from "./types"; -import { getBlockFrostInstance } from "./utils"; -import { load } from "js-yaml"; - -const blockFrostInstance = getBlockFrostInstance(); -const blockFrostAdapter = new BlockFrostAdapter(blockFrostInstance); -const tokenApi = new TokenAPI(); -const marketcapApi = new MarketCapAPI(blockFrostAdapter); - -async function getToken(tokenId: string) { - try { - const __dirname = import.meta.dirname; - const filePath = path.join( - __dirname, - `../need-update-apis/${tokenId}.yaml` - ); - const tokenFileData = fs.readFileSync(filePath, "utf-8"); - const tokenData: TokenMetadata = { - tokenId, - ...(load(tokenFileData) as Omit), - }; - return tokenData; - } catch (e) { - console.error(e); - return null; - } -} - -function moveFile(tokenFileName: string) { - const oldPath = `../need-update-apis/${tokenFileName}`; - const newPath = `./tokens/${tokenFileName}`; - fs.rename(oldPath, newPath, (err) => { - if (err) { - console.error("Could not move file", err); - } - }); -} - -async function test() { - const __dirname = import.meta.dirname; - const tokenFileDir = path.join(__dirname, "../need-update-apis"); - fs.readdir(tokenFileDir, async (error, files) => { - if (error) { - console.log(error); - } - for (const file of files) { - const tokenId = file.split(".")[0]; - const tokenInfo = await getToken(tokenId); - if ( - tokenInfo - ) { - console.log( - tokenInfo.tokenId.slice(0, 56), - tokenInfo.tokenId.slice(56) - ); - try { - const marketcapInfo = await marketcapApi.getMarketCapInfo(tokenInfo); - console.log(marketcapInfo); - } catch {} - } - } - }); -} -test(); diff --git a/src/tokenSchema.ts b/src/tokenSchema.ts index 8b47977..a701790 100644 --- a/src/tokenSchema.ts +++ b/src/tokenSchema.ts @@ -59,31 +59,6 @@ export const tokenSchema: JSONSchemaType = { }, nullable: true, }, - // $defs: { - // resource: { - // type: "array", - // items: { - // oneOf: [ - // { - // type: "string", - // pattern: ADDRESS_REGEX, - // }, - // { - // type: "string", - // pattern: URL_REGEX, - // }, - // { - // type: "string", - // pattern: ASSET_ID_REGEX, - // }, - // { - // type: "number", - // }, - // ], - // }, - // nullable: true, - // }, - // }, treasury: { type: "array", items: { diff --git a/src/tokens/03dc510dbd1d1321edc06d8ae013f55fdd79f390c7415e2a09b64797534e4f4b.yaml b/src/tokens/03dc510dbd1d1321edc06d8ae013f55fdd79f390c7415e2a09b64797534e4f4b.yaml index 8f8c3d7..25a89ad 100644 --- a/src/tokens/03dc510dbd1d1321edc06d8ae013f55fdd79f390c7415e2a09b64797534e4f4b.yaml +++ b/src/tokens/03dc510dbd1d1321edc06d8ae013f55fdd79f390c7415e2a09b64797534e4f4b.yaml @@ -1,12 +1,19 @@ project: SNOK + categories: - Meme + socialLinks: twitter: https://x.com/snokmedaddy + verified: true + maxSupply: '1000000000' + decimals: 0 + treasury: - stake17x7ep02m028rqsnrqmse4zyn8nr3v80nkeshq73n2xddxnsmw0uuw + burn: - addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4 diff --git a/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb14727352534e.yaml b/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb14727352534e.yaml index f659abe..f5b911a 100644 --- a/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb14727352534e.yaml +++ b/src/tokens/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb14727352534e.yaml @@ -1,15 +1,21 @@ project: Rosen Bridge + categories: - Other + socialLinks: website: https://rosen.tech/ twitter: https://twitter.com/RosenBridge_erg discord: https://discord.com/invite/AHgsxhDKrQ telegram: https://t.me/rosenbridge_erg coinGecko: https://www.coingecko.com/en/coins/rosen-bridge + verified: true + decimals: 3 + maxSupply: 1000000000000 + treasury: - addr1x8x6ca648w25x085dg8xs6k5e69yemr5hakcnl0gshmal6gahwzvy33q3jhr74lurpr9p0n8derw58fh7snq2zwxe8zsdkcqrj - addr1v8kqhz5lkdxqm8qtkn4lgd9f4890v0j6advjfmk5k9amu4c535lsu # lock address diff --git a/src/utils.ts b/src/utils.ts index 0069bad..fa33a99 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -15,19 +15,14 @@ export function formatNumber(value: bigint, decimals: number): string { return `0.${numberString.padStart(decimals, "0")}`; } - const postfix = numberString - .slice(numberString.length - decimals) - .replace(/0+$/g, ""); + const postfix = numberString.slice(numberString.length - decimals).replace(/0+$/g, ""); const decimalPoint = postfix.length ? "." : ""; const prefix = numberString.slice(0, numberString.length - decimals); return prefix + decimalPoint + postfix; } export function isBigInt(value: string | number): boolean { - return ( - !Number.isNaN(Number(value)) && - value.toString() === tryParseBigInt(value)?.toString() - ); + return !Number.isNaN(Number(value)) && value.toString() === tryParseBigInt(value)?.toString(); } export function isAPIEndPoint(str: string | number): boolean { @@ -35,27 +30,20 @@ export function isAPIEndPoint(str: string | number): boolean { } export function isAddress(str: string | number): boolean { - return ( - typeof str === "string" && - (str.startsWith("addr") || str.startsWith("stake")) - ); + return typeof str === "string" && (str.startsWith("addr") || str.startsWith("stake")); } -export async function getAmountFromURL( - url: string, - decimals: number -): Promise { +export async function getAmountFromURL(url: string, decimals: number): Promise { const response = await fetch(url); - let data = await response.text(); - // - if (data.includes(".")) { - const [prefix, postfix] = data.split("."); - console.log({ prefix, postfix, decimals }); + let amount = await response.text(); + // format to support APIs which return amount with decimal places + if (amount.includes(".")) { + const [prefix, postfix] = amount.split("."); if (postfix.length > decimals) { return null; } - data = prefix + postfix.padEnd(decimals, "0"); + amount = prefix + postfix.padEnd(decimals, "0"); } - return tryParseBigInt(data); + return tryParseBigInt(amount); } From 22868530bd5d027d5d997afbcafd1da473123280 Mon Sep 17 00:00:00 2001 From: rinchan01 Date: Wed, 27 Nov 2024 18:02:03 +0700 Subject: [PATCH 3/7] update README.md --- README.md | 21 ++++++++++++++------- internal/checkTVL.ts | 5 +++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f6a1f4d..c3c2b01 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Minswap tokens +# 😽 Minswap tokens ## Overview @@ -10,8 +10,12 @@ In cases where `circulatingOnChain` is provided directly according to the asset' For tokens providing with `treasuryNft`, the `circulating` is the quantity of the asset in the latest address containing it. -## Requirements -As token verification prerequisites, ensure your token has a pool with at least **1000 ADA TVL** and follow the structure stated in the instructions below. +## How to add my token +### Requirements +As token verification prerequisites, ensure your token has: +- A pool with at least **1000 ADA TVL** +- A logo added in the [Cardano Token Registry](https://github.com/cardano-foundation/cardano-token-registry) or CIP-68 metadata +and follow the structure stated in the instructions below. For tokens to be verified: 1. Create a transaction transfer **100 ADA** to Minswap wallet receiving token verification fee below. @@ -23,11 +27,9 @@ Minswap wallet receiving token verification fee: `addr1q85g6fkwzr2cf984qdmntqthl Any token that has been verified does not meet the requirements in the future would still be unverified. +### Create pull request - -## How to add my token - -Create a pull request adding yaml file according to the following structure in the `src/tokens`: +1. Create a pull request adding yaml file according to the following structure in the `src/tokens`: ```yaml # 1 token = 1 yaml file @@ -73,6 +75,11 @@ circulatingOnChain: treasuryNft: assetId ``` +Alternatively, create an issue with above information and our team will update accordingly. The pull request will be processed faster. + +2. Post your policy ID on Twitter or display your policy ID on your landing page. +3. Our team will verify and approve in first-in-first-out order. + ## Usage ```ts diff --git a/internal/checkTVL.ts b/internal/checkTVL.ts index b069309..558fefa 100644 --- a/internal/checkTVL.ts +++ b/internal/checkTVL.ts @@ -44,7 +44,9 @@ async function verifyTVL() { if (newVerified === tokenData.verified) { continue; } - + console.log( + `TVL check failed, changing verification information from ${tokenData.verified} to ${newVerified}...`, + ); const tokenInfo = { ...tokenData, verified: newVerified, @@ -60,7 +62,6 @@ async function verifyTVL() { } async function checkTVL(v1Pools: SDK.PoolV1.State[], v2Pools: SDK.PoolV2.State[], tokenId: string): Promise { - console.log(`Checking TVL for token ${tokenId}...`); if (STABLE_COINS.includes(tokenId)) { return true; } From a49fc19eac914d48e6a128c613ba1a4da7987535 Mon Sep 17 00:00:00 2001 From: rinchan01 Date: Thu, 28 Nov 2024 11:59:06 +0700 Subject: [PATCH 4/7] update tokens files and README.md --- README.md | 11 +++++------ internal/checkTVL.ts | 2 +- src/adapters/types.ts | 2 +- src/apis/tokenApi.ts | 5 +++-- ...2db42e20f2fd3125f541e5d6c5a3d70b4dda17c2daa82.yaml | 5 +++++ ...eb2e7846950ae08dce757f1e753554741522042555348.yaml | 5 +++++ 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c3c2b01..a2f16dd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ As of latest update, we consider `circulating = maxSupply - treasury - burn` and In cases where `circulatingOnChain` is provided directly according to the asset's quantity on-chain or through external APIs, the `circulating` is the value of `circulatingOnChain`. -For tokens providing with `treasuryNft`, the `circulating` is the quantity of the asset in the latest address containing it. +For tokens providing with `treasuryNft`, the `circulating` is the quantity of the address containing the assets. In default, the amount is retrieved from the oldest address from the blockchain's point of view. ## How to add my token ### Requirements @@ -16,10 +16,11 @@ As token verification prerequisites, ensure your token has: - A pool with at least **1000 ADA TVL** - A logo added in the [Cardano Token Registry](https://github.com/cardano-foundation/cardano-token-registry) or CIP-68 metadata and follow the structure stated in the instructions below. +- A post of your policy ID on Twitter or your policy ID displayed on your landing page. For tokens to be verified: -1. Create a transaction transfer **100 ADA** to Minswap wallet receiving token verification fee below. -2. Metadata includes: **the last 4 numbers of asset's policyId and asset's ticker**. +1. Create a transaction transfer **100 ADA** to Minswap wallet receiving token verification fee below. This fee appears as the cost for lifetime maintain this repository. +2. Metadata includes: **the last 4 numbers of asset's policyId and asset's ticker** (for example, Verify 70c6 MIN). 3. Attach the transaction hash to a comment in the yaml file pull request (instructions below). @@ -76,9 +77,7 @@ treasuryNft: assetId ``` Alternatively, create an issue with above information and our team will update accordingly. The pull request will be processed faster. - -2. Post your policy ID on Twitter or display your policy ID on your landing page. -3. Our team will verify and approve in first-in-first-out order. +Our team will verify and approve in first-in-first-out order. ## Usage diff --git a/internal/checkTVL.ts b/internal/checkTVL.ts index 558fefa..f7d2a25 100644 --- a/internal/checkTVL.ts +++ b/internal/checkTVL.ts @@ -32,7 +32,7 @@ const blockfrostAdapter = new SDK.BlockfrostAdapter({ async function verifyTVL() { const [v1Pools, { pools: v2Pools }] = await Promise.all([getAllV1Pools(), blockfrostAdapter.getAllV2Pools()]); - fs.readdir(TOKEN_DIR, async function (error, files) { + fs.readdir(TOKEN_DIR, async (error, files) => { if (error) { throw error; } diff --git a/src/adapters/types.ts b/src/adapters/types.ts index 5d2e48e..112c3ff 100644 --- a/src/adapters/types.ts +++ b/src/adapters/types.ts @@ -18,7 +18,7 @@ export type Adapter = { /** * Get the amount held in the address holding a specific asset by the asset's ID. - * After obtaining a list of addresses possessing a specific asset in descending order, this retrieve the amount associated with the first address returned. + * After obtaining a list of addresses possessing a specific asset in blockchain's point of view ascending order, this retrieve the amount associated with the first address returned. * This function currently supports Shen and DJED. * @param tokenId The token's policy ID. * @param nftId The concatenation of token's policy ID and hex-coded token name. diff --git a/src/apis/tokenApi.ts b/src/apis/tokenApi.ts index 9451960..f2fac8e 100644 --- a/src/apis/tokenApi.ts +++ b/src/apis/tokenApi.ts @@ -14,7 +14,8 @@ export class TokenAPI { public async getToken(tokenId: string) { try { const __dirname = import.meta.dirname; - const filePath = path.join(__dirname, `../${TOKENS_DIR}/${tokenId}.yaml`); + console.log(__dirname, TOKENS_DIR, tokenId); + const filePath = path.join(__dirname, `${TOKENS_DIR}/${tokenId}.yaml`); const tokenFileData = fs.readFileSync(filePath, "utf-8"); const tokenData: TokenMetadata = { tokenId, @@ -34,7 +35,7 @@ export class TokenAPI { */ public async getTokens(options?: GetTokenOptions) { const __dirname = import.meta.dirname; - const directory = path.join(__dirname, `../${TOKENS_DIR}`); + const directory = path.join(__dirname, `${TOKENS_DIR}`); const tokenList: TokenMetadata[] = []; const files = fs.readdirSync(directory); for (const file of files) { diff --git a/src/tokens/2852268cf6e2db42e20f2fd3125f541e5d6c5a3d70b4dda17c2daa82.yaml b/src/tokens/2852268cf6e2db42e20f2fd3125f541e5d6c5a3d70b4dda17c2daa82.yaml index 5e1c468..1c4b476 100644 --- a/src/tokens/2852268cf6e2db42e20f2fd3125f541e5d6c5a3d70b4dda17c2daa82.yaml +++ b/src/tokens/2852268cf6e2db42e20f2fd3125f541e5d6c5a3d70b4dda17c2daa82.yaml @@ -14,3 +14,8 @@ decimals: 6 verified: true +maxSupply: 25000000000000 + +treasury: + - stake178j4fcxw7pwgxw92yu28c2zqmjxnumumj52hxr9jtr6qwngf2ve5n # O Vesting Multisig + diff --git a/src/tokens/766fce8055f39d40fcfc19721677b3deb2e7846950ae08dce757f1e753554741522042555348.yaml b/src/tokens/766fce8055f39d40fcfc19721677b3deb2e7846950ae08dce757f1e753554741522042555348.yaml index 8c08225..e0927ad 100644 --- a/src/tokens/766fce8055f39d40fcfc19721677b3deb2e7846950ae08dce757f1e753554741522042555348.yaml +++ b/src/tokens/766fce8055f39d40fcfc19721677b3deb2e7846950ae08dce757f1e753554741522042555348.yaml @@ -10,3 +10,8 @@ decimals: 0 verified: true +maxSupply: + +burn: + - addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4 + From 393f172205689d63a2286841f62760c62ea2af7d Mon Sep 17 00:00:00 2001 From: James Ng Date: Thu, 28 Nov 2024 12:17:01 +0700 Subject: [PATCH 5/7] refactor Signed-off-by: James Ng --- src/apis/tokenApi.ts | 3 +-- ...e4b9f78d28bd67266396331f46528c397461647568.yaml | 2 +- ...9a665ce554f00ac89d2e99a1a83d267170c64d494e.yaml | 14 +++++++------- ...665ce554f00ac89d2e99a1a83d267170c64d494e74.yaml | 4 ++-- ...f8b7f1de615ff8f6de097a5ce62b257b534841524c.yaml | 2 +- ...f62b092814fb14581ec3a3d5160014df10434f4445.yaml | 2 +- ...8306d6317570f60014df104d494e20496e7465726e.yaml | 2 +- ...cee3c546c77226cd89a04b3aaeae6a65589e4d6f6d.yaml | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/apis/tokenApi.ts b/src/apis/tokenApi.ts index f2fac8e..7fcd6f6 100644 --- a/src/apis/tokenApi.ts +++ b/src/apis/tokenApi.ts @@ -14,7 +14,6 @@ export class TokenAPI { public async getToken(tokenId: string) { try { const __dirname = import.meta.dirname; - console.log(__dirname, TOKENS_DIR, tokenId); const filePath = path.join(__dirname, `${TOKENS_DIR}/${tokenId}.yaml`); const tokenFileData = fs.readFileSync(filePath, "utf-8"); const tokenData: TokenMetadata = { @@ -35,7 +34,7 @@ export class TokenAPI { */ public async getTokens(options?: GetTokenOptions) { const __dirname = import.meta.dirname; - const directory = path.join(__dirname, `${TOKENS_DIR}`); + const directory = path.join(__dirname, TOKENS_DIR); const tokenList: TokenMetadata[] = []; const files = fs.readdirSync(directory); for (const file of files) { diff --git a/src/tokens/12274673b36fa1507084eae4b9f78d28bd67266396331f46528c397461647568.yaml b/src/tokens/12274673b36fa1507084eae4b9f78d28bd67266396331f46528c397461647568.yaml index 1adf37d..6b69d13 100644 --- a/src/tokens/12274673b36fa1507084eae4b9f78d28bd67266396331f46528c397461647568.yaml +++ b/src/tokens/12274673b36fa1507084eae4b9f78d28bd67266396331f46528c397461647568.yaml @@ -8,5 +8,5 @@ socialLinks: decimals: 0 -verified: false +verified: true diff --git a/src/tokens/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e.yaml b/src/tokens/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e.yaml index 097a91e..9e0ea38 100644 --- a/src/tokens/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e.yaml +++ b/src/tokens/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e.yaml @@ -18,11 +18,11 @@ maxSupply: '3000000000000000' decimals: 6 treasury: - - addr1vx00uxlpkzgkrga47zdypj40a3yjs0u3wad88kdy9l3rekcrmyz69 - - addr1zymeshes0pxnr2s4v95a4wchxs74l0lqt5n3f6rxynnepgjj2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq64anuz - - addr1z87vw6ts32hywu4j4kyk9qfgd36zhzx3y7fc786vgzlc57zj2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq9rwl7c - - addr1z9wdv59sq7zzy2l6gchq3247lz7ssfsxs45nj4njhwsp5uzj2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pqzygnta - - addr1z9mjhq5c4s0smv2c92g9yvecpju3p8cfaneu8jzwq97ry62j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pqw9pw55 - - addr1zx0wxal6dz7rjzxk2mwfvj9564rp9uajqrscftx44tp6ha6j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq83j9cv - - addr1q8zntywq3fldecrqk4vl593sznvj7483ejcajnavvh2qpsvftaax5f3wasl5m49rtjw5pen938vr7863w0lfz94h0lfqldx3pu + - addr1vx00uxlpkzgkrga47zdypj40a3yjs0u3wad88kdy9l3rekcrmyz69 # unconverted MIN for MINt + - addr1zymeshes0pxnr2s4v95a4wchxs74l0lqt5n3f6rxynnepgjj2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq64anuz # team + - addr1z87vw6ts32hywu4j4kyk9qfgd36zhzx3y7fc786vgzlc57zj2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq9rwl7c # dev fund + - addr1z9wdv59sq7zzy2l6gchq3247lz7ssfsxs45nj4njhwsp5uzj2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pqzygnta # DAO + - addr1z9mjhq5c4s0smv2c92g9yvecpju3p8cfaneu8jzwq97ry62j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pqw9pw55 # incentives & partnerships + - addr1zx0wxal6dz7rjzxk2mwfvj9564rp9uajqrscftx44tp6ha6j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq83j9cv # yield farming treasury + - addr1q8zntywq3fldecrqk4vl593sznvj7483ejcajnavvh2qpsvftaax5f3wasl5m49rtjw5pen938vr7863w0lfz94h0lfqldx3pu # $min.dao-hot aka DAO hot wallet diff --git a/src/tokens/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e74.yaml b/src/tokens/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e74.yaml index ff8197a..049dec5 100644 --- a/src/tokens/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e74.yaml +++ b/src/tokens/29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e74.yaml @@ -18,6 +18,6 @@ maxSupply: '100000000000000' decimals: 6 treasury: - - addr1v9urht2tqg7ncs7r545qdj2wn5tpam5l04t7eyermpmyvmg5xf2mt - - addr1w9p9akyhpqsy0xq79g8hspy90xl9htxfrd3mama6py42jjgtvfgn8 + - addr1v9urht2tqg7ncs7r545qdj2wn5tpam5l04t7eyermpmyvmg5xf2mt # FISO + - addr1w9p9akyhpqsy0xq79g8hspy90xl9htxfrd3mama6py42jjgtvfgn8 # DripDropz diff --git a/src/tokens/590f6d119b214cdcf7ef7751f8b7f1de615ff8f6de097a5ce62b257b534841524c.yaml b/src/tokens/590f6d119b214cdcf7ef7751f8b7f1de615ff8f6de097a5ce62b257b534841524c.yaml index 5dcc32e..3ecbe72 100644 --- a/src/tokens/590f6d119b214cdcf7ef7751f8b7f1de615ff8f6de097a5ce62b257b534841524c.yaml +++ b/src/tokens/590f6d119b214cdcf7ef7751f8b7f1de615ff8f6de097a5ce62b257b534841524c.yaml @@ -14,4 +14,4 @@ maxSupply: 999000000000 decimals: 0 treasury: - - addr1xxyyxezq2d2qkrusm2fvkztm696egu75yrjs2r5psgvkuzyggdjyq565pv8epk5jevyhh5t4j3eagg89q58grqsedcyqgcrtav + - addr1xxyyxezq2d2qkrusm2fvkztm696egu75yrjs2r5psgvkuzyggdjyq565pv8epk5jevyhh5t4j3eagg89q58grqsedcyqgcrtav # community wallet diff --git a/src/tokens/9a1dfe73344033e70deab8c5c28c00f62b092814fb14581ec3a3d5160014df10434f4445.yaml b/src/tokens/9a1dfe73344033e70deab8c5c28c00f62b092814fb14581ec3a3d5160014df10434f4445.yaml index 986a89c..7de2bf1 100644 --- a/src/tokens/9a1dfe73344033e70deab8c5c28c00f62b092814fb14581ec3a3d5160014df10434f4445.yaml +++ b/src/tokens/9a1dfe73344033e70deab8c5c28c00f62b092814fb14581ec3a3d5160014df10434f4445.yaml @@ -11,5 +11,5 @@ socialLinks: decimals: 7 -verified: true +verified: false diff --git a/src/tokens/af65a4734e8a22f43128913567566d2dde30d3b3298306d6317570f60014df104d494e20496e7465726e.yaml b/src/tokens/af65a4734e8a22f43128913567566d2dde30d3b3298306d6317570f60014df104d494e20496e7465726e.yaml index 88b34a4..fe1e055 100644 --- a/src/tokens/af65a4734e8a22f43128913567566d2dde30d3b3298306d6317570f60014df104d494e20496e7465726e.yaml +++ b/src/tokens/af65a4734e8a22f43128913567566d2dde30d3b3298306d6317570f60014df104d494e20496e7465726e.yaml @@ -11,5 +11,5 @@ socialLinks: decimals: 6 -verified: false +verified: true diff --git a/src/tokens/ed5517ccf67c60004355cee3c546c77226cd89a04b3aaeae6a65589e4d6f6d.yaml b/src/tokens/ed5517ccf67c60004355cee3c546c77226cd89a04b3aaeae6a65589e4d6f6d.yaml index f018667..486eaa3 100644 --- a/src/tokens/ed5517ccf67c60004355cee3c546c77226cd89a04b3aaeae6a65589e4d6f6d.yaml +++ b/src/tokens/ed5517ccf67c60004355cee3c546c77226cd89a04b3aaeae6a65589e4d6f6d.yaml @@ -9,7 +9,7 @@ socialLinks: telegram: https://t.me/+7ndbw5QA7ppkOGFk twitter: https://x.com/mom_on_ada -verified: true +verified: false maxSupply: '200000000000000' From 7af392233047ecfad34eb49cb66510289c518470 Mon Sep 17 00:00:00 2001 From: James Ng Date: Thu, 28 Nov 2024 12:22:12 +0700 Subject: [PATCH 6/7] verify some tokens Signed-off-by: James Ng --- package.json | 2 +- ...447d3c2e6a50641a15c57770e27cb9d507357696e67526964657273.yaml | 2 +- ...fdb54504859875b1827b60ba679074996156461143dc14f5054494d.yaml | 2 +- ...1f5b665f567b01baec8bc2771804b4c21716a87a4e353504c415348.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 6db5b31..e687733 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@minswap/minswap-tokens", - "version": "1.0.2", + "version": "1.0.3", "description": "The merge of deprecated verified-tokens and market-cap repositories, which contains a list of tokens, exposes APIs for transparent access to circulating supply and total supply.", "main": "build/index.js", "module": "build/index.es.js", diff --git a/src/tokens/c0ee29a85b13209423b10447d3c2e6a50641a15c57770e27cb9d507357696e67526964657273.yaml b/src/tokens/c0ee29a85b13209423b10447d3c2e6a50641a15c57770e27cb9d507357696e67526964657273.yaml index 67a6af1..c49b08e 100644 --- a/src/tokens/c0ee29a85b13209423b10447d3c2e6a50641a15c57770e27cb9d507357696e67526964657273.yaml +++ b/src/tokens/c0ee29a85b13209423b10447d3c2e6a50641a15c57770e27cb9d507357696e67526964657273.yaml @@ -12,7 +12,7 @@ socialLinks: coinMarketCap: https://coinmarketcap.com/currencies/wingriders coinGecko: https://www.coingecko.com/en/coins/wingriders -verified: false +verified: true decimals: 6 diff --git a/src/tokens/e52964af4fffdb54504859875b1827b60ba679074996156461143dc14f5054494d.yaml b/src/tokens/e52964af4fffdb54504859875b1827b60ba679074996156461143dc14f5054494d.yaml index 33049a6..6ffdfa3 100644 --- a/src/tokens/e52964af4fffdb54504859875b1827b60ba679074996156461143dc14f5054494d.yaml +++ b/src/tokens/e52964af4fffdb54504859875b1827b60ba679074996156461143dc14f5054494d.yaml @@ -10,7 +10,7 @@ socialLinks: discord: https://discord.gg/VZ329q7x69 coinGecko: https://www.coingecko.com/en/coins/optim -verified: false +verified: true maxSupply: '100000000000000' diff --git a/src/tokens/ececc92aeaaac1f5b665f567b01baec8bc2771804b4c21716a87a4e353504c415348.yaml b/src/tokens/ececc92aeaaac1f5b665f567b01baec8bc2771804b4c21716a87a4e353504c415348.yaml index 8a1f0d6..7171447 100644 --- a/src/tokens/ececc92aeaaac1f5b665f567b01baec8bc2771804b4c21716a87a4e353504c415348.yaml +++ b/src/tokens/ececc92aeaaac1f5b665f567b01baec8bc2771804b4c21716a87a4e353504c415348.yaml @@ -8,7 +8,7 @@ socialLinks: twitter: https://x.com/splashprotocol discord: https://discord.gg/NAvMKrQq9g -verified: false +verified: true maxSupply: '100000000000000' From 3c844803b6c0341facb8b637fdc1722accadab82 Mon Sep 17 00:00:00 2001 From: James Ng Date: Thu, 28 Nov 2024 12:24:48 +0700 Subject: [PATCH 7/7] publish version v1.0.3 --- biome.json | 2 +- package.json | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/biome.json b/biome.json index b986f96..979c7b9 100644 --- a/biome.json +++ b/biome.json @@ -6,7 +6,7 @@ }, "files": { "ignoreUnknown": false, - "ignore": ["node_modules/**", ".vscode/**", ".husky", "build", "src/tokens", "*.config.js"] + "ignore": ["node_modules/**", ".vscode/**", ".husky", "build", "src/tokens", "*.config.js", "package.json"] }, "formatter": { "bracketSpacing": true, diff --git a/package.json b/package.json index e687733..c73729e 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,14 @@ "prepare": "husky install" }, "lint-staged": { - "*": ["pnpm lint", "pnpm check-format"] + "*": [ + "pnpm lint", + "pnpm check-format" + ] }, - "files": ["build"], + "files": [ + "build" + ], "exports": { ".": { "types": "./build/index.d.ts", @@ -26,7 +31,12 @@ "require": "./build/index.js" } }, - "keywords": ["minswap", "cardano", "dex", "blockchain"], + "keywords": [ + "minswap", + "cardano", + "dex", + "blockchain" + ], "author": "Minswap Labs", "license": "ISC", "repository": {