Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Commit 2078c03

Browse files
committed
update mnt
Signed-off-by: James Ng <[email protected]>
1 parent c29d023 commit 2078c03

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/tokens/mnt.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
import { defaultFetcherOptions, SupplyFetcher } from "../types";
22
import { getAxiosInstance } from "../utils";
33

4-
// eslint-disable-next-line unused-imports/no-unused-vars
5-
const MNT = "43b07d4037f0d75ee10f9863097463fc02ff3c0b8b705ae61d9c75bf";
6-
7-
const TOTAL_SUPPLY = 100_000_000;
8-
9-
const MNT_SUPPLY_ADDRESS = "https://www.mynth.ai/api/token-supply";
10-
114
const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
125
const axios = getAxiosInstance(options);
13-
const response = await axios.get(MNT_SUPPLY_ADDRESS);
14-
const treasury = response.data.current_supply;
6+
const [totalSupplyResponse, circulatingResponse] = await Promise.all([
7+
axios.get("https://www.mynth.ai/api/total-supply"),
8+
axios.get("https://www.mynth.ai/api/current-supply"),
9+
]);
10+
const totalSupply = Number(totalSupplyResponse.data) / 1e6;
11+
const circulating = Number(circulatingResponse.data) / 1e6;
1512

1613
return {
17-
circulating: treasury.toString(),
18-
total: TOTAL_SUPPLY.toString(),
14+
total: totalSupply.toString(),
15+
circulating: circulating.toString(),
1916
};
2017
};
2118

0 commit comments

Comments
 (0)