Skip to content

Commit 2e33c6e

Browse files
committed
Merge branch 'develop'
2 parents 652baf6 + ce3701c commit 2e33c6e

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

app/stats/page.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff 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>

lib/api/general.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@ import { TokenSupplyResponse } from '@/typedefs/general';
55
const dappApiUrl = 'https://dapp-api.ratio1.ai';
66

77
export 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
}

0 commit comments

Comments
 (0)