diff --git a/src/components/Select.tsx b/src/components/Select.tsx index f4d5c5e604..3a37ac9faa 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -55,11 +55,11 @@ const SelectedWrap = styled.div` text-overflow: ellipsis; flex: 1; ` -export type SelectOption = { value?: string | number; label: string | number; onSelect?: () => void } +export type SelectOption = { value?: string | number; label: ReactNode; onSelect?: () => void } const getOptionValue = (option: SelectOption | undefined) => { if (!option) return '' - return typeof option !== 'object' ? option : option.value ?? option.label + return typeof option !== 'object' ? option : option.value ?? '' } const getOptionLabel = (option: SelectOption | undefined) => { if (!option) return '' diff --git a/src/pages/TrueSightV2/components/KyberAIWidget.tsx b/src/pages/TrueSightV2/components/KyberAIWidget.tsx index 3127dd54c1..5f547e3f8b 100644 --- a/src/pages/TrueSightV2/components/KyberAIWidget.tsx +++ b/src/pages/TrueSightV2/components/KyberAIWidget.tsx @@ -203,7 +203,7 @@ export default function Widget() { const { data, isFetching, isError } = useTokenListQuery( activeTab === WidgetTab.MyWatchlist - ? { type: KyberAIListType.ALL, page: 1, pageSize: 5, watchlist: true } + ? { type: KyberAIListType.ALL, page: 1, pageSize: 5, watchlist: 'all' } : { type: { [WidgetTab.Bearish]: KyberAIListType.BEARISH, diff --git a/src/pages/TrueSightV2/components/MultipleChainDropdown.tsx b/src/pages/TrueSightV2/components/MultipleChainDropdown.tsx index 0c82854688..7c288a5de0 100644 --- a/src/pages/TrueSightV2/components/MultipleChainDropdown.tsx +++ b/src/pages/TrueSightV2/components/MultipleChainDropdown.tsx @@ -73,7 +73,7 @@ const MultipleChainDropdown = React.forwardRef( ( props: { show: boolean - tokens?: Array<{ address: string; logo: string; chain: string }> + tokens?: Array<{ address: string; chain: string }> onChainClick: (chain: string, address: string) => void }, ref, @@ -90,7 +90,7 @@ const MultipleChainDropdown = React.forwardRef( - {tokens?.map((item: { address: string; logo: string; chain: string }) => { + {tokens?.map((item: { address: string; chain: string }) => { if (item.chain === 'ethereum') return ( e.stopPropagation()} > - {tokens?.map((item: { address: string; logo: string; chain: string }) => { + {tokens?.map((item: { address: string; chain: string }) => { if (item.chain === 'ethereum') return ( { + const kyberScore3D = token.kyberScore3D?.[token.kyberScore3D.length - 1] return { - assetId: token.asset_id, + assetId: token.assetId, name: token.name, symbol: token.symbol, - logo: token.tokens[0].logo, + logo: token.logo, price: token.price, - priceChange24h: token.percent_change_24h, + priceChange24h: token.priceChange24H, kyberScore: { - score: token.ks_3d?.[token.ks_3d.length - 1].kyber_score || 0, - label: token.ks_3d?.[token.ks_3d.length - 1].tag || '', + score: kyberScore3D?.kyberScore || 0, + label: kyberScore3D?.tag || '', }, } } diff --git a/src/pages/TrueSightV2/components/SmallKyberScoreMeter.tsx b/src/pages/TrueSightV2/components/SmallKyberScoreMeter.tsx index 07f4d86fc8..4ae7a6377b 100644 --- a/src/pages/TrueSightV2/components/SmallKyberScoreMeter.tsx +++ b/src/pages/TrueSightV2/components/SmallKyberScoreMeter.tsx @@ -28,7 +28,7 @@ const GaugeValue = styled.div` bottom: 6px; ` function SmallKyberScoreMeter({ data, disabledTooltip }: { data?: IKyberScoreChart; disabledTooltip?: boolean }) { - const value = data?.kyber_score + const value = data?.kyberScore const theme = useTheme() const emptyColor = theme.darkMode ? theme.subText + '30' : theme.border + '60' const activeGaugeValue = value ? (gaugeList.length * value) / 100 : 0 @@ -56,12 +56,12 @@ function SmallKyberScoreMeter({ data, disabledTooltip }: { data?: IKyberScoreCha data ? ( - Calculated at {data.created_at ? dayjs(data.created_at * 1000).format('DD/MM/YYYY HH:mm A') : '--'} + Calculated at {data.createdAt ? dayjs(data.createdAt * 1000).format('DD/MM/YYYY HH:mm A') : '--'} KyberScore:{' '} - - {data.kyber_score || '--'} ({data.tag || t`Not Applicable`}) + + {data.kyberScore || '--'} ({data.tag || t`Not Applicable`}) diff --git a/src/pages/TrueSightV2/components/TokenFilter/WatchlistSelect.tsx b/src/pages/TrueSightV2/components/TokenFilter/WatchlistSelect.tsx index a1141e9443..9f8e879d63 100644 --- a/src/pages/TrueSightV2/components/TokenFilter/WatchlistSelect.tsx +++ b/src/pages/TrueSightV2/components/TokenFilter/WatchlistSelect.tsx @@ -1,7 +1,9 @@ -import { t } from '@lingui/macro' +import { Trans, t } from '@lingui/macro' import { useMemo, useState } from 'react' import { CSSProperties } from 'styled-components' +import Icon from 'components/Icons/Icon' +import Row from 'components/Row' import { SelectOption } from 'components/Select' import { ActiveSelectItem, StyledSelect } from 'pages/TrueSightV2/components/TokenFilter' import { ManageListModal } from 'pages/TrueSightV2/components/WatchlistButton' @@ -27,8 +29,22 @@ const WatchlistSelect = ({ return { value: e.id + '', label: `${e.name} (${e.assetNumber})` } }) || [] - opts.unshift({ label: t`All Tokens (${total})`, value: '' }) - opts.push({ label: t`Manage Lists`, onSelect: () => setIsOpen(true) }) // todo danh: update like desgin + opts.unshift({ + label: ( + + All Tokens ({total}) + + ), + value: '', + }) + opts.push({ + label: ( + + Manage Lists + + ), + onSelect: () => setIsOpen(true), + }) // todo danh: update like desgin return opts }, [dataWatchList]) diff --git a/src/pages/TrueSightV2/components/TokenListVariants.tsx b/src/pages/TrueSightV2/components/TokenListVariants.tsx index ce3a4a807b..24dc09521d 100644 --- a/src/pages/TrueSightV2/components/TokenListVariants.tsx +++ b/src/pages/TrueSightV2/components/TokenListVariants.tsx @@ -20,7 +20,7 @@ export default function TokenListVariants({ tokens, iconSize = 12, }: { - tokens: Array<{ address: string; logo: string; chain: string }> + tokens: Array<{ address: string; chain: string }> iconSize?: number }) { const theme = useTheme() diff --git a/src/pages/TrueSightV2/components/TokenOverview.tsx b/src/pages/TrueSightV2/components/TokenOverview.tsx index 2edf4f4ed7..fa8a656f8b 100644 --- a/src/pages/TrueSightV2/components/TokenOverview.tsx +++ b/src/pages/TrueSightV2/components/TokenOverview.tsx @@ -316,12 +316,12 @@ export const TokenOverview = ({ data, isLoading }: { data?: IAssetOverview; isLo <> - Calculated at {dayjs(latestKyberscore.created_at * 1000).format('DD/MM/YYYY HH:mm A')} + Calculated at {dayjs(latestKyberscore.createdAt * 1000).format('DD/MM/YYYY HH:mm A')} KyberScore:{' '} - - {latestKyberscore.kyber_score || '--'} ({latestKyberscore.tag || t`Not Applicable`}) + + {latestKyberscore.kyberScore || '--'} ({latestKyberscore.tag || t`Not Applicable`}) @@ -534,7 +534,7 @@ export const TokenOverview = ({ data, isLoading }: { data?: IAssetOverview; isLo setShowShare(true)} /> - + @@ -555,12 +555,12 @@ export const TokenOverview = ({ data, isLoading }: { data?: IAssetOverview; isLo <> - {latestKyberscore && dayjs(latestKyberscore?.created_at * 1000).format('DD/MM/YYYY HH:mm A')} + {latestKyberscore && dayjs(latestKyberscore?.createdAt * 1000).format('DD/MM/YYYY HH:mm A')} KyberScore:{' '} - - {latestKyberscore?.kyber_score || '--'} ({latestKyberscore?.tag || t`Not Applicable`}) + + {latestKyberscore?.kyberScore || '--'} ({latestKyberscore?.tag || t`Not Applicable`}) diff --git a/src/pages/TrueSightV2/components/chart/KyberScoreChart.tsx b/src/pages/TrueSightV2/components/chart/KyberScoreChart.tsx index f3b0355c82..d1846ae029 100644 --- a/src/pages/TrueSightV2/components/chart/KyberScoreChart.tsx +++ b/src/pages/TrueSightV2/components/chart/KyberScoreChart.tsx @@ -54,7 +54,7 @@ export default function KyberScoreChart({ const startTimestamp = Math.floor(Date.now() / 14400000) * 14400 for (let i = 0; i < 18; i++) { const timestamp = startTimestamp - i * 14400 - const index = data.findIndex(item => item.created_at === timestamp) + const index = data.findIndex(item => item.createdAt === timestamp) if (index >= 0) { datatemp.push(data[index]) } else { @@ -86,7 +86,7 @@ export default function KyberScoreChart({ {filledData?.map((item, index) => { - const v = item?.kyber_score || 0 + const v = item?.createdAt || 0 const gap = 2 const rectWidth = (100 - (filledData.length - 1) * gap) / filledData.length const rectHeight = !v ? 21 : Math.max((v * 21) / 100, 0.8) @@ -124,16 +124,16 @@ export default function KyberScoreChart({ Calculated at{' '} - {hoveringItem?.created_at && dayjs(hoveringItem?.created_at * 1000).format('DD/MM/YYYY hh:mm A')} + {hoveringItem?.createdAt && dayjs(hoveringItem?.createdAt * 1000).format('DD/MM/YYYY hh:mm A')} KyberScore:{' '} {hoveringItem ? !!hoveringItem.tag - ? `${hoveringItem.kyber_score} (${hoveringItem.tag})` + ? `${hoveringItem.kyberScore} (${hoveringItem.tag})` : 'N/A' : '--'} diff --git a/src/pages/TrueSightV2/components/shareContent/ExploreTopShareContent.tsx b/src/pages/TrueSightV2/components/shareContent/ExploreTopShareContent.tsx index c66e11bac1..dc9d40315f 100644 --- a/src/pages/TrueSightV2/components/shareContent/ExploreTopShareContent.tsx +++ b/src/pages/TrueSightV2/components/shareContent/ExploreTopShareContent.tsx @@ -83,6 +83,13 @@ export default function ExploreShareContent({ token, mobileMode }: { token?: IAs const last7daysPrice = data?.data[0]?.['7daysprice'] const formattedData = last7daysPrice ? [...last7daysPrice].sort((a, b) => a.timestamp - b.timestamp).slice(1, 8) : [] const priceChangeColor = token && token.price24hChangePercent > 0 ? theme.primary : theme.red + const msgTimeScore = ( + + Calculated at {latestKyberscore ? dayjs(latestKyberscore?.createdAt * 1000).format('HH:mm A, MMM DD') : ''} when + price was {latestKyberscore ? '$' + formatTokenPrice(latestKyberscore.price) : '--'} + + ) + if (mobileMode) { return ( @@ -118,16 +125,10 @@ export default function ExploreShareContent({ token, mobileMode }: { token?: IAs KyberScore - - - Calculated at{' '} - {latestKyberscore ? dayjs(latestKyberscore?.created_at * 1000).format('HH:mm A, MMM DD') : ''} when price - was {latestKyberscore ? '$' + formatTokenPrice(latestKyberscore.price) : '--'} - - + {msgTimeScore} {token?.symbol?.toUpperCase()} seems to be{' '} - + {latestKyberscore ? latestKyberscore.tag : ''} @@ -159,15 +160,9 @@ export default function ExploreShareContent({ token, mobileMode }: { token?: IAs - - - Calculated at{' '} - {latestKyberscore ? dayjs(latestKyberscore?.created_at * 1000).format('HH:mm A, MMM DD') : ''} when price - was {latestKyberscore ? '$' + formatTokenPrice(latestKyberscore.price) : '--'} - - + {msgTimeScore} @@ -175,7 +170,7 @@ export default function ExploreShareContent({ token, mobileMode }: { token?: IAs {token?.symbol?.toUpperCase()} seems to be{' '} - + {latestKyberscore ? latestKyberscore.tag : ''} diff --git a/src/pages/TrueSightV2/components/shareContent/KyberScoreShareContent.tsx b/src/pages/TrueSightV2/components/shareContent/KyberScoreShareContent.tsx index fcd4e2d202..2d19f2138b 100644 --- a/src/pages/TrueSightV2/components/shareContent/KyberScoreShareContent.tsx +++ b/src/pages/TrueSightV2/components/shareContent/KyberScoreShareContent.tsx @@ -25,12 +25,12 @@ export default function KyberScoreShareContent({ - Calculated at {latestKyberscore ? dayjs(latestKyberscore?.created_at * 1000).format('HH:mm A, MMM DD') : ''}{' '} + Calculated at {latestKyberscore ? dayjs(latestKyberscore?.createdAt * 1000).format('HH:mm A, MMM DD') : ''}{' '} when price was {latestKyberscore ? '$' + formatTokenPrice(latestKyberscore.price) : '--'} @@ -38,7 +38,7 @@ export default function KyberScoreShareContent({ {token?.symbol?.toUpperCase()} seems to be{' '} - + {latestKyberscore ? latestKyberscore.tag : ''} diff --git a/src/pages/TrueSightV2/components/table/index.tsx b/src/pages/TrueSightV2/components/table/index.tsx index ef808f48a8..308131fada 100644 --- a/src/pages/TrueSightV2/components/table/index.tsx +++ b/src/pages/TrueSightV2/components/table/index.tsx @@ -580,18 +580,17 @@ const WidgetTokenRow = ({ const theme = useTheme() const navigate = useNavigate() - const latestKyberScore: IKyberScoreChart | undefined = token?.ks_3d?.[token.ks_3d.length - 1] - const hasMutipleChain = token?.tokens?.length > 1 + const latestKyberScore: IKyberScoreChart | undefined = token?.kyberScore3D?.[token.kyberScore3D.length - 1] + const hasMutipleChain = token?.addresses?.length > 1 const [showSwapMenu, setShowSwapMenu] = useState(false) const rowRef = useRef(null) useOnClickOutside(rowRef, () => setShowSwapMenu(false)) + const tokens = token.addresses || [] const handleRowClick = () => { - navigate( - `${APP_PATHS.KYBERAI_EXPLORE}/${token.asset_id}?chain=${token.tokens[0].chain}&address=${token.tokens[0].address}`, - ) + navigate(`${APP_PATHS.KYBERAI_EXPLORE}/${token.assetId}?chain=${tokens[0].chain}&address=${tokens[0].address}`) onClick?.() } @@ -600,7 +599,7 @@ const WidgetTokenRow = ({ if (hasMutipleChain) { setShowSwapMenu(true) } else { - navigateToSwapPage({ address: token.tokens[0].address, chain: token.tokens[0].chain }) + navigateToSwapPage({ address: tokens[0].address, chain: tokens[0].chain }) } } @@ -646,33 +645,27 @@ const WidgetTokenRow = ({ - - tokenInList + + tokenInList {token.symbol} {' '} - {/* */} + {/* */} ${formatTokenPrice(token.price)} - 0 ? theme.primary : theme.red}> + 0 ? theme.primary : theme.red}> 0 ? '180deg' : '0deg'} - color={token.percent_change_24h > 0 ? theme.primary : theme.red} + rotate={token.priceChange24H > 0 ? '180deg' : '0deg'} + color={token.priceChange24H > 0 ? theme.primary : theme.red} /> - {Math.abs(token.percent_change_24h).toFixed(2)}% + {Math.abs(token.priceChange24H).toFixed(2)}% @@ -682,19 +675,13 @@ const WidgetTokenRow = ({ <> - + - tokenInList + tokenInList {token.symbol}{' '} - + @@ -704,7 +691,7 @@ const WidgetTokenRow = ({ @@ -717,13 +704,13 @@ const WidgetTokenRow = ({ ${formatTokenPrice(token.price)} - 0 ? theme.primary : theme.red}> + 0 ? theme.primary : theme.red}> 0 ? '180deg' : '0deg'} - color={token.percent_change_24h > 0 ? theme.primary : theme.red} + rotate={token.priceChange24H > 0 ? '180deg' : '0deg'} + color={token.priceChange24H > 0 ? theme.primary : theme.red} /> - {Math.abs(token.percent_change_24h).toFixed(2)}% + {Math.abs(token.priceChange24H).toFixed(2)}% @@ -731,7 +718,7 @@ const WidgetTokenRow = ({ )} - + @@ -745,7 +732,7 @@ const WidgetTokenRow = ({ {hasMutipleChain && ( <> - + )} @@ -1122,7 +1109,7 @@ export const TokenListInShareModalTable = ({ {data.map((token, index) => { - const latestKyberscore = token.ks_3d ? token.ks_3d[token.ks_3d.length - 1] : null + const latestKyberscore = token.kyberScore3D ? token.kyberScore3D[token.kyberScore3D.length - 1] : null return ( {index + 1 + startIndex} @@ -1130,7 +1117,7 @@ export const TokenListInShareModalTable = ({ tokenInList {token.symbol.toUpperCase()} - {token.tokens.slice(0, 6).map(item => { - const size = token.tokens.length > 6 ? '12px' : '14px' + {token.addresses.slice(0, 6).map(item => { + const size = token.addresses.length > 6 ? '12px' : '14px' return })} - {token.tokens.length > 6 && ...} + {token.addresses.length > 6 && ...} @@ -1151,21 +1138,21 @@ export const TokenListInShareModalTable = ({ 14 ? '14px' : '16px'}> ${formatTokenPrice(token.price)} - 0 ? theme.primary : theme.red}> + 0 ? theme.primary : theme.red}> 0 ? '180deg' : '0deg'} - color={token.percent_change_24h > 0 ? theme.primary : theme.red} + rotate={token.priceChange24H > 0 ? '180deg' : '0deg'} + color={token.priceChange24H > 0 ? theme.primary : theme.red} /> - {Math.abs(token.percent_change_24h).toFixed(2)}% + {Math.abs(token.priceChange24H).toFixed(2)}% {!mobileMode && ( - - {latestKyberscore?.kyber_score} + + {latestKyberscore?.kyberScore} )} diff --git a/src/pages/TrueSightV2/hooks/useKyberAIData.tsx b/src/pages/TrueSightV2/hooks/useKyberAIData.tsx index 9c661a7cb6..263e479c62 100644 --- a/src/pages/TrueSightV2/hooks/useKyberAIData.tsx +++ b/src/pages/TrueSightV2/hooks/useKyberAIData.tsx @@ -33,24 +33,20 @@ const kyberAIApi = createApi({ //1. tokenList: builder.query<{ data: ITokenList[]; totalItems: number }, QueryTokenParams>({ query: ({ type, chain, page, pageSize, watchlist, keywords, ...filter }) => ({ - url: '/tokens', + url: '/assets', params: { ...filter, type: type || 'all', - chain: 'all', // todo remove page: page || 1, size: pageSize || 10, - watchlist: watchlist ? 'true' : undefined, + watchlist, keywords, }, }), transformResponse: (res: any) => { - if (res.code === 0) { - return { data: res.data.data.contents, totalItems: res.data.paging.totalItems } - } - throw new Error(res.msg) + return { data: res.data.assets, totalItems: res.data.pagination.totalItems } }, - providesTags: (result, error, arg) => (arg.watchlist === true ? ['myWatchList', 'tokenList'] : ['tokenList']), + providesTags: (_, __, arg) => (arg.watchlist === 'string' ? ['myWatchList', 'tokenList'] : ['tokenList']), }), assetOverview: builder.query({ query: ({ assetId }: { assetId?: string }) => ({ diff --git a/src/pages/TrueSightV2/pages/TokenAnalysisList.tsx b/src/pages/TrueSightV2/pages/TokenAnalysisList.tsx index 8141f7dea5..9515513a3e 100644 --- a/src/pages/TrueSightV2/pages/TokenAnalysisList.tsx +++ b/src/pages/TrueSightV2/pages/TokenAnalysisList.tsx @@ -491,24 +491,21 @@ const TokenRow = React.memo(function TokenRow({ useOnClickOutside(rowRef, () => setShowSwapMenu(false)) const above768 = useMedia(`(min-width:${MEDIA_WIDTHS.upToSmall}px)`) - - const hasMutipleChain = token.tokens.length > 1 + const tokens = token.addresses || [] + const hasMutipleChain = tokens.length > 1 const handleRowClick = () => { - navigate( - `${APP_PATHS.KYBERAI_EXPLORE}/${token.asset_id}?chain=${token.tokens[0].chain}&address=${token.tokens[0].address}`, - { - state: { from: location }, - }, - ) + navigate(`${APP_PATHS.KYBERAI_EXPLORE}/${token.assetId}?chain=${tokens[0].chain}&address=${tokens[0].address}`, { + state: { from: location }, + }) } - const latestKyberScore: IKyberScoreChart | undefined = token?.ks_3d?.[token.ks_3d.length - 1] + const latestKyberScore: IKyberScoreChart | undefined = token?.kyberScore3D?.[token.kyberScore3D.length - 1] return ( - + - + {above768 ? index : <>} @@ -525,7 +522,7 @@ const TokenRow = React.memo(function TokenRow({ > tokenInList - {token.symbol}{' '} - + {token.symbol} @@ -543,7 +539,7 @@ const TokenRow = React.memo(function TokenRow({ @@ -552,18 +548,18 @@ const TokenRow = React.memo(function TokenRow({ - + ${formatTokenPrice(token.price)} - 0 ? theme.primary : theme.red}> + 0 ? theme.primary : theme.red}> 0 ? '180deg' : '0deg'} - color={token.percent_change_24h > 0 ? theme.primary : theme.red} + rotate={token.priceChange24H > 0 ? '180deg' : '0deg'} + color={token.priceChange24H > 0 ? theme.primary : theme.red} /> - {Math.abs(token.percent_change_24h).toFixed(2)}% + {Math.abs(token.priceChange24H).toFixed(2)}% @@ -574,10 +570,10 @@ const TokenRow = React.memo(function TokenRow({ $ {currentTab === KyberAIListType.TOP_CEX_INFLOW - ? formatLocaleStringNum(token.cex_inflow_24h - token.cex_outflow_24h) || '--' + ? formatLocaleStringNum(token.cexNetflow24H) || '--' : currentTab === KyberAIListType.TOP_CEX_OUTFLOW - ? formatLocaleStringNum(token.cex_outflow_24h - token.cex_inflow_24h) || '--' - : formatLocaleStringNum(token.volume_24h) || '--'} + ? formatLocaleStringNum(token.cexNetflow24H) || '--' + : formatLocaleStringNum(token.volume24H) || '--'} {[KyberAIListType.TOP_CEX_INFLOW, KyberAIListType.TOP_CEX_OUTFLOW, KyberAIListType.TRENDING_SOON].includes( currentTab, @@ -607,7 +603,7 @@ const TokenRow = React.memo(function TokenRow({ option: 'explore', }) navigate( - `${APP_PATHS.KYBERAI_EXPLORE}/${token.asset_id}?chain=${token.tokens[0].chain}&address=${token.tokens[0].address}`, + `${APP_PATHS.KYBERAI_EXPLORE}/${token.assetId}?chain=${tokens[0].chain}&address=${tokens[0].address}`, { state: { from: location }, }, @@ -630,7 +626,7 @@ const TokenRow = React.memo(function TokenRow({ if (hasMutipleChain) { setShowSwapMenu(true) } else { - navigateToSwapPage(token.tokens[0]) + navigateToSwapPage(token.addresses[0]) } }} > @@ -641,7 +637,7 @@ const TokenRow = React.memo(function TokenRow({ <> { if (chain && address) { navigateToSwapPage({ chain, address }) @@ -723,7 +719,7 @@ export default function TokenAnalysisList() { const queryParams = useMemo(() => { const params: QueryTokenParams = { page, pageSize, ...filter } if (listTypeParam === KyberAIListType.MYWATCHLIST) { - params.watchlist = true + params.watchlist = filter.watchlist || 'all' params.type = KyberAIListType.ALL } else { params.type = listTypeParam @@ -737,8 +733,8 @@ export default function TokenAnalysisList() { const kyberscoreCalculateAt = useMemo(() => { const listData = data?.data || [] const timestamps = listData.map(token => { - const latestKyberScore: IKyberScoreChart | undefined = token?.ks_3d?.[token.ks_3d.length - 1] - return latestKyberScore?.created_at || 0 + const latestKyberScore: IKyberScoreChart | undefined = token?.kyberScore3D?.[token.kyberScore3D.length - 1] + return latestKyberScore?.createdAt || 0 }) return Math.max(...timestamps, 0) }, [data]) @@ -1005,7 +1001,7 @@ export default function TokenAnalysisList() { listData.map((token: ITokenList, index: number) => ( + assetId: string + addresses: Array<{ address: string; chain: string }> + logo: string price: number - percent_change_24h: number - volume_24h: number + priceChange24H: number + volume24H: number '7daysprice': Array<{ value: number; timestamp: number }> - kyber_score: number - ks_3d?: Array + kyberScore: number + kyberScore3D?: Array kyber_tag: string market_cap: number isWatched: boolean cex_inflow_3days: number cex_outflow_3days: number - cex_inflow_24h: number - cex_outflow_24h: number + cexNetflow24H: number cex_netflow_3days: number discovered_on?: number } @@ -231,6 +231,6 @@ export type QueryTokenParams = { chain?: string page?: number pageSize?: number - watchlist?: boolean + watchlist?: string keywords?: string }