File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed
Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export default async function StatsPage() {
2525
2626 try {
2727 [ tokenSupply , r1Price ] = await Promise . all ( [ getTokenSupply ( ) , fetchR1Price ( ) ] ) ;
28+ console . log ( 'StatsPage' , tokenSupply , r1Price ) ;
2829 } catch ( error ) {
2930 console . error ( error ) ;
3031 redirect ( routePath . notFound ) ;
@@ -60,13 +61,6 @@ export default async function StatsPage() {
6061
6162 < CardHorizontal label = "Burned" value = { fN ( tokenSupply . burned ) } isFlexible widthClasses = "min-w-[140px]" />
6263 </ div >
63-
64- { /* <CardHorizontal
65- label="$R1 Price"
66- value={`$${parseFloat((Number((r1Price * scale) / divisor) / Number(scale)).toFixed(2))}`}
67- isFlexible
68- widthClasses="min-w-[150px]"
69- /> */ }
7064 </ div >
7165 </ BorderedCard >
7266 </ div >
Original file line number Diff line number Diff line change @@ -5,17 +5,14 @@ import { TokenSupplyResponse } from '@/typedefs/general';
55const dappApiUrl = 'https://dapp-api.ratio1.ai' ;
66
77export async function getTokenSupply ( ) : Promise < TokenSupplyResponse > {
8- let response : Response | undefined ;
8+ const response : Response | undefined = await fetch ( `${ dappApiUrl } /token/supply` , {
9+ next : { revalidate : 300 } ,
10+ } ) ;
911
10- try {
11- response = await fetch ( `${ dappApiUrl } /token/supply` , {
12- next : { revalidate : 300 } ,
13- } ) ;
14-
15- const data = await response . json ( ) ;
16- return data ;
17- } catch ( error ) {
18- console . error ( error ) ;
12+ if ( ! response . ok ) {
1913 throw new Error ( 'Failed to fetch token supply' ) ;
2014 }
15+
16+ const data = await response . json ( ) ;
17+ return data ;
2118}
You can’t perform that action at this time.
0 commit comments