This repository was archived by the owner on Dec 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 11import { defaultFetcherOptions , SupplyFetcher } from "../types" ;
22import { 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-
114const 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
You can’t perform that action at this time.
0 commit comments