From 3d76a68f7bcfd6da090984c30d2599db2d6dfdc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Tue, 7 May 2024 12:40:52 +0200 Subject: [PATCH] fix prospective api --- pages/api/tokens.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pages/api/tokens.ts b/pages/api/tokens.ts index 0734f28a..f0d391b6 100644 --- a/pages/api/tokens.ts +++ b/pages/api/tokens.ts @@ -22,8 +22,8 @@ export default async function handler( `https://public-api.birdeye.so/defi/tokenlist?sort_by=v24hUSD&sort_type=desc&offset=${offset}&limit=50`, options, ) - const tokenListResponse = await response.json() + const tokenListResponse = await response.json() const tokenList = tokenListResponse['data']['tokens'] const filteredTokens = [] @@ -35,7 +35,7 @@ export default async function handler( const nowInSeconds = Math.floor(now.getTime() / 1000) const pastDate = new Date() pastDate.setDate(pastDate.getDate() - 4) - pastDate.setMonth(pastDate.getMonth() - 1) + pastDate.setMonth(pastDate.getMonth() - 1.5) const pastDateInSeconds = Math.floor(pastDate.getTime() / 1000) // Fetch history for the token @@ -44,7 +44,6 @@ export default async function handler( options, ) const historyData = await historyResponse.json() - if (historyData['data']['items']?.length >= 35) { const detailResponse = await fetch( `https://public-api.birdeye.so/defi/token_overview?address=${address}`, @@ -61,7 +60,6 @@ export default async function handler( } } } - // Return the filtered list of tokens res.status(200).json(filteredTokens) } catch (error) {