Skip to content

Commit

Permalink
chore: Remove old info gateway (pancakeswap#10036)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjojoex authored Jun 18, 2024
1 parent 878dea5 commit de6d3fa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions apps/web/src/config/constants/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export const ACCESS_RISK_API = 'https://red.alert.pancakeswap.com/red-api'

export const CELER_API = 'https://api.celerscan.com/scan'

export const INFO_GATEWAY_OLD_API = 'https://info-gateway.pancakeswap.com'

export const V2_SUBGRAPH_URLS = {
...V2_SUBGRAPHS,
[ChainId.POLYGON_ZKEVM]: `${THE_GRAPH_PROXY_API}/exchange-v2-polygon-zkevm`,
Expand Down
9 changes: 0 additions & 9 deletions apps/web/src/state/info/queries/tokens/topTokens.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { INFO_GATEWAY_OLD_API } from 'config/constants/endpoints'
import { gql } from 'graphql-request'
import union from 'lodash/union'
import { useCallback, useEffect, useState } from 'react'
import { getDeltaTimestamps } from 'utils/getDeltaTimestamps'
import {
MultiChainNameExtend,
Expand All @@ -10,7 +8,6 @@ import {
multiChainTokenBlackList,
multiChainTokenWhiteList,
} from '../../constant'
import { useGetChainName } from '../../hooks'

interface TopTokensResponse {
tokenDayDatas: {
Expand All @@ -30,12 +27,6 @@ interface StableSwapTopTokensResponse {
* Note: dailyTxns_gt: 300 is there to prevent fetching incorrectly priced tokens with high dailyVolumeUSD
*/
const fetchTopTokens = async (chainName: MultiChainNameExtend, timestamp24hAgo: number): Promise<string[]> => {
if (chainName === 'BSC' && !checkIsStableSwap()) {
const resp = await fetch(`${INFO_GATEWAY_OLD_API}/v0/top-tokens/bsc`)
const result = await resp.json()
return union(result.tokenDayDatas.map((t) => t.id.split('-')[0]))
}

const whereCondition =
chainName === 'ETH'
? `where: { date_gt: ${timestamp24hAgo}, token_not_in: $blacklist, dailyVolumeUSD_gt:2000 }`
Expand Down

0 comments on commit de6d3fa

Please sign in to comment.