@@ -37,25 +37,23 @@ import zytronCTA from "./temp-assets/zytronCTA.jpg";
3737
3838// END TEMPORARY
3939
40+ import { API_SERVER_URL } from "@/constants/env" ;
4041import type { ChainMetadata } from "thirdweb/chains" ;
4142import type {
4243 ChainMetadataWithServices ,
4344 ChainService ,
4445 ChainServices ,
4546} from "./types/chain" ;
4647
47- const THIRDWEB_API_HOST =
48- process . env . NEXT_PUBLIC_THIRDWEB_API_HOST || "https://api.thirdweb.com" ;
49-
5048export async function getChains ( ) {
5149 const [ chains , chainServices ] = await Promise . all ( [
5250 fetch (
53- `${ THIRDWEB_API_HOST } /v1/chains` ,
51+ `${ API_SERVER_URL } /v1/chains` ,
5452 // revalidate every 60 minutes
5553 { next : { revalidate : 60 * 60 } } ,
5654 ) . then ( ( res ) => res . json ( ) ) as Promise < { data : ChainMetadata [ ] } > ,
5755 fetch (
58- `${ THIRDWEB_API_HOST } /v1/chains/services` ,
56+ `${ API_SERVER_URL } /v1/chains/services` ,
5957 // revalidate every 60 minutes
6058 { next : { revalidate : 60 * 60 } } ,
6159 ) . then ( ( res ) => res . json ( ) ) as Promise < {
@@ -77,12 +75,12 @@ export async function getChain(
7775) : Promise < ChainMetadataWithServices > {
7876 const [ chain , chainServices ] = await Promise . all ( [
7977 fetch (
80- `${ THIRDWEB_API_HOST } /v1/chains/${ chainIdOrSlug } ` ,
78+ `${ API_SERVER_URL } /v1/chains/${ chainIdOrSlug } ` ,
8179 // revalidate every 15 minutes
8280 { next : { revalidate : 15 * 60 } } ,
8381 ) . then ( ( res ) => res . json ( ) ) as Promise < { data : ChainMetadata } > ,
8482 fetch (
85- `${ THIRDWEB_API_HOST } /v1/chains/${ chainIdOrSlug } /services` ,
83+ `${ API_SERVER_URL } /v1/chains/${ chainIdOrSlug } /services` ,
8684 // revalidate every 15 minutes
8785 { next : { revalidate : 15 * 60 } } ,
8886 ) . then ( ( res ) => res . json ( ) ) as Promise < { data : ChainServices } > ,
0 commit comments