Skip to content

Commit

Permalink
remove mock tokens from tokenDetailTable
Browse files Browse the repository at this point in the history
  • Loading branch information
foxier25 committed Nov 22, 2024
1 parent 95e9824 commit 994ab01
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Tokens/TokenTable/TokenTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
usePollQueryWhileMounted,
} from '../../../graphql/data/util'
import { id } from 'make-plural';
import { TOKENS_LUX_LIST } from 'tokens-lux/tokens'

const getTokenInfoQuery = gql`
query MyQuery {
Expand Down Expand Up @@ -163,9 +164,15 @@ const getCurrentHourTimestamp = (): string => {
// You can pass these date values as parameters to your transformed tokens calculation.
const todayDate = getTodayDate();
const currentHourTime = getCurrentHourTimestamp();
const tokenAddresses = TOKENS_LUX_LIST.tokens
.filter((token) => token.chainId === 96369) // Filter by chainId
.map((token) => token.address.toUpperCase()); // Extract the address

console.log("tokenAddresses",tokenAddresses);

export default function TokenTable() {
const chainName = validateUrlChainParam(useParams<{ chainName?: string }>().chainName);
console.log("chainName", chainName);

const { data: luxData, loading: luxLoading, refetch } = useQuery(getTokenInfoQuery, {
client: luxClient,
Expand All @@ -180,7 +187,8 @@ export default function TokenTable() {
// Helper function to calculate transformed tokens
const calculateTransformedTokens = useCallback(() => {
refetch();
return luxData?.tokens?.map((token: any) => {
return luxData?.tokens
?.filter((token: any) => tokenAddresses.includes(token.id.toUpperCase())).map((token: any) => {
const tokenDayData = token.tokenDayData || [];
const tokenHourData = token.tokenHourData || [];
let nowPrice = 0;
Expand Down

0 comments on commit 994ab01

Please sign in to comment.