diff --git a/src/app/api/gas-price/route.ts b/src/app/api/gas-price/route.ts deleted file mode 100644 index eb701b9..0000000 --- a/src/app/api/gas-price/route.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { NextResponse } from 'next/server'; - -export const runtime = 'edge'; - -export async function GET() { - try { - const response = await fetch( - 'https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd', - { - headers: { - 'Accept': 'application/json', - }, - cache: 'no-store', - } - ); - - if (!response.ok) { - console.error(`CoinGecko API error: ${response.status} ${response.statusText}`); - throw new Error(`CoinGecko API error: ${response.statusText}`); - } - - const data = await response.json(); - - return NextResponse.json(data, { - headers: { - 'Cache-Control': 'public, s-maxage=60, stale-while-revalidate=120', - }, - }); - } catch (error) { - console.error('Error fetching gas price:', error); - return NextResponse.json( - { error: 'Failed to fetch gas price', details: error instanceof Error ? error.message : 'Unknown error' }, - { status: 500 } - ); - } -}