From 2078c032ae017fbc6a0f3c25905aa6dfcb7f7ccc Mon Sep 17 00:00:00 2001 From: James Ng Date: Sun, 8 Dec 2024 18:25:35 +0700 Subject: [PATCH] update mnt Signed-off-by: James Ng --- src/tokens/mnt.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/tokens/mnt.ts b/src/tokens/mnt.ts index 9769ffa5..9835bf5d 100644 --- a/src/tokens/mnt.ts +++ b/src/tokens/mnt.ts @@ -1,21 +1,18 @@ import { defaultFetcherOptions, SupplyFetcher } from "../types"; import { getAxiosInstance } from "../utils"; -// eslint-disable-next-line unused-imports/no-unused-vars -const MNT = "43b07d4037f0d75ee10f9863097463fc02ff3c0b8b705ae61d9c75bf"; - -const TOTAL_SUPPLY = 100_000_000; - -const MNT_SUPPLY_ADDRESS = "https://www.mynth.ai/api/token-supply"; - const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { const axios = getAxiosInstance(options); - const response = await axios.get(MNT_SUPPLY_ADDRESS); - const treasury = response.data.current_supply; + const [totalSupplyResponse, circulatingResponse] = await Promise.all([ + axios.get("https://www.mynth.ai/api/total-supply"), + axios.get("https://www.mynth.ai/api/current-supply"), + ]); + const totalSupply = Number(totalSupplyResponse.data) / 1e6; + const circulating = Number(circulatingResponse.data) / 1e6; return { - circulating: treasury.toString(), - total: TOTAL_SUPPLY.toString(), + total: totalSupply.toString(), + circulating: circulating.toString(), }; };