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

Commit

Permalink
update mnt
Browse files Browse the repository at this point in the history
Signed-off-by: James Ng <theuranus.ntb@gmail.com>
  • Loading branch information
0xj4m35 committed Dec 8, 2024
1 parent c29d023 commit 2078c03
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/tokens/mnt.ts
Original file line number Diff line number Diff line change
@@ -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(),
};
};

Expand Down

0 comments on commit 2078c03

Please sign in to comment.