Skip to content

Commit c82b606

Browse files
committed
[MNY-166] Dashboard: Add Dex Screener charts in public ERC20 token page (#8035)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR primarily focuses on removing the `token-price-data` API and the `PriceChart` component, while introducing a new `DexScreener` feature that displays token price information based on the chain ID and contract address. ### Detailed summary - Deleted `token-price-data.ts` and `PriceChart.tsx`. - Added `mapChainIdToDexScreenerChainSlug` to map chain IDs to DexScreener chain slugs. - Introduced `DexScreener` and `DexScreenerIframe` components for displaying token price data. - Updated `erc20.tsx` to integrate `DexScreener` and remove token price fetching logic. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added embedded DexScreener chart on ERC20 public pages for supported chains with automatic light/dark theming and responsive SSR fallback. * Introduced chain-to-DexScreener slug mapping for type-safe embeds. * **Refactor** * Removed token price data fetching and the TokenStats/price chart UI from ERC20 public pages. * **Style** * Widened layout to max-w-7xl, simplified Buy section spacing, and moved DexScreener before analytics; analytics and recent transfers now sit in a unified bottom container. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 1c6b124 commit c82b606

File tree

5 files changed

+189
-372
lines changed

5 files changed

+189
-372
lines changed

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_apis/token-price-data.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/_components/PriceChart.tsx

Lines changed: 0 additions & 264 deletions
This file was deleted.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
export const mapChainIdToDexScreenerChainSlug = {
2+
8453: "base",
3+
1: "ethereum",
4+
56: "bsc",
5+
369: "pulsechain",
6+
137: "polygon",
7+
2741: "abstract",
8+
43114: "avalanche",
9+
999: "hyperliquid",
10+
480: "worldchain",
11+
42161: "arbitrum",
12+
388: "cronos",
13+
59144: "linea",
14+
1514: "story",
15+
397: "near",
16+
295: "hedera",
17+
146: "sonic",
18+
10: "optimism",
19+
80094: "berachain",
20+
57073: "ink",
21+
130: "unichain",
22+
5000: "mantle",
23+
324: "zksync",
24+
466: "apechain",
25+
1116: "core",
26+
250: "fantom",
27+
1868: "soneium",
28+
81457: "blast",
29+
2000: "dogechain",
30+
14: "flare",
31+
2040: "vana",
32+
4337: "beam",
33+
109: "shibarium",
34+
747: "flowevm",
35+
1088: "metis",
36+
1030: "conflux",
37+
43113: "avalanchedfk",
38+
534352: "scroll",
39+
747474: "katana",
40+
42220: "celo",
41+
1284: "moonbeam",
42+
4200: "merlinchain",
43+
2222: "kava",
44+
39797: "energi",
45+
34443: "mode",
46+
252: "fraxtal",
47+
48900: "zircuit",
48+
20: "elastos",
49+
100: "gnosischain",
50+
204: "opbnb",
51+
169: "manta",
52+
1313161554: "aurora",
53+
3073: "movement",
54+
4689: "iotex",
55+
23294: "oasissapphire",
56+
6001: "bouncebit",
57+
42170: "arbitrumnova",
58+
1101: "polygonzkevm",
59+
40: "telos",
60+
592: "astar",
61+
42262: "oasisemerald",
62+
1285: "moonriver",
63+
245022934: "neonevm",
64+
7777777: "zora",
65+
122: "fuse",
66+
321: "kcc",
67+
1234: "stepnetwork",
68+
106: "velas",
69+
167000: "taiko",
70+
288: "boba",
71+
42766: "zkfair",
72+
32520: "bitgert",
73+
82: "meter",
74+
} as const;
75+
76+
export type DexScreenerChainSlug =
77+
(typeof mapChainIdToDexScreenerChainSlug)[keyof typeof mapChainIdToDexScreenerChainSlug];

0 commit comments

Comments
 (0)