From 0ba24fe05e4fff4de9fe4cafd46c479e91d38fab Mon Sep 17 00:00:00 2001
From: TITI <162849030+0xtiti@users.noreply.github.com>
Date: Thu, 15 Aug 2024 18:04:06 -0300
Subject: [PATCH 1/2] feat: error page (#24)
---
public/locales/en/common.json | 4 +++
public/locales/es/common.json | 4 +++
src/containers/ErrorContainer/index.tsx | 33 +++++++++++++++++++++++++
src/containers/index.ts | 1 +
src/pages/error.tsx | 29 +++++++++++++++++++++-
src/utils/services.ts | 4 ++-
6 files changed, 73 insertions(+), 2 deletions(-)
create mode 100644 src/containers/ErrorContainer/index.tsx
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index f7e7e2f..5c0440a 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -80,6 +80,10 @@
"madeWith": "Made with",
"by": "by"
},
+ "ERROR":{
+ "title": "Error",
+ "message": "An error occurred while fetching the data. Please try again later."
+ },
"LOCALES": {
"en": "English",
"es": "Spanish"
diff --git a/public/locales/es/common.json b/public/locales/es/common.json
index 9041076..f0366ca 100644
--- a/public/locales/es/common.json
+++ b/public/locales/es/common.json
@@ -81,6 +81,10 @@
"madeWithLove": "Hecho con",
"by": "por"
},
+ "ERROR": {
+ "title": "Error",
+ "message": "Lo sentimos, algo salió mal. Por favor, inténtelo de nuevo más tarde."
+ },
"LOCALES": {
"en": "Inglés",
"es": "Español"
diff --git a/src/containers/ErrorContainer/index.tsx b/src/containers/ErrorContainer/index.tsx
new file mode 100644
index 0000000..3547829
--- /dev/null
+++ b/src/containers/ErrorContainer/index.tsx
@@ -0,0 +1,33 @@
+import { Typography } from '@mui/material';
+import { styled } from '@mui/material/styles';
+import { useTranslation } from 'next-i18next';
+
+import { Title } from '~/components';
+
+export const ErrorContainer = () => {
+ const { t } = useTranslation();
+
+ return (
+
+
+ {t('ERROR.message')}
+
+ );
+};
+
+const ErrorPageContainer = styled('main')(({ theme }) => ({
+ display: 'flex',
+ flexDirection: 'column',
+ padding: '0 7rem',
+ alignItems: 'center',
+ justifyContent: 'center',
+ width: '100%',
+ gap: '4rem',
+ marginTop: '4rem',
+ marginBottom: '4rem',
+ minHeight: 'calc(100vh - 19rem)',
+ [theme.breakpoints.down('sm')]: {
+ padding: '0 1rem',
+ minHeight: 'calc(100vh - 23rem)',
+ },
+}));
diff --git a/src/containers/index.ts b/src/containers/index.ts
index bf93c22..93640e1 100644
--- a/src/containers/index.ts
+++ b/src/containers/index.ts
@@ -8,3 +8,4 @@ export * from './ChainDetail';
export * from './ChainDetail/ChainDescription';
export * from './ChainDetail/ChainMetadata';
export * from './Tokens';
+export * from './ErrorContainer';
diff --git a/src/pages/error.tsx b/src/pages/error.tsx
index cb4879f..228cef6 100644
--- a/src/pages/error.tsx
+++ b/src/pages/error.tsx
@@ -1,5 +1,32 @@
+import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
+import { GetStaticProps } from 'next';
+import { useTranslation } from 'next-i18next';
+
+import { CustomHead } from '~/components';
+import { getConfig } from '~/config';
+import { ErrorContainer } from '~/containers';
+
+const { DEFAULT_LANG, SUPPORTED_LANGUAGES } = getConfig();
+
const ErrorPage = () => {
- return
Sorry, something went wrong.
;
+ const { t } = useTranslation();
+
+ return (
+ <>
+
+
+ >
+ );
+};
+
+export const getStaticProps: GetStaticProps = async ({ locale }) => {
+ const i18Config = await serverSideTranslations(locale || DEFAULT_LANG, ['common'], null, SUPPORTED_LANGUAGES);
+
+ return {
+ props: {
+ ...i18Config,
+ },
+ };
};
export default ErrorPage;
diff --git a/src/utils/services.ts b/src/utils/services.ts
index b315190..b4da13c 100644
--- a/src/utils/services.ts
+++ b/src/utils/services.ts
@@ -6,13 +6,15 @@ const { API_URL } = getConfig();
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
+console.log('Fetching backend data from:', API_URL);
+
export const fetchEcosystemData = async () => {
// temporary for mock data
if (!API_URL) {
await delay(2000); // Simulate 2 seconds delay
return Promise.resolve(ecosystemMockData);
}
- const res = await fetch(`${API_URL}/ecosystem`);
+ const res = await fetch(`${API_URL}/metrics/ecosystem`);
if (!res.ok) {
throw new Error('Failed to fetch ecosystem data');
}
From c289218b4a7541e6028d8edac84c4447be5e7633 Mon Sep 17 00:00:00 2001
From: TITI <162849030+0xtiti@users.noreply.github.com>
Date: Thu, 15 Aug 2024 19:42:38 -0300
Subject: [PATCH 2/2] feat: backend integration schema (#26)
---
src/components/Breadcrumb.tsx | 2 +-
src/components/ChainInformation.tsx | 12 +-
src/components/ChainTable.tsx | 37 +-
src/components/RPC.tsx | 42 +-
src/components/TvlContentBox.tsx | 2 +-
src/containers/ChainDetail/ChainMetadata.tsx | 17 +-
src/containers/Dashboard/index.tsx | 2 +-
src/containers/LockedAssets/index.tsx | 3 +
src/containers/Tokens/TokensTable.tsx | 2 +-
src/data/chainMockData.json | 610 +++++++++++++++---
src/data/ecosystemMockData.json | 635 ++++++++++++++++---
src/pages/[chain]/index.tsx | 9 +-
src/providers/DataProvider.tsx | 18 +-
src/types/Data.ts | 60 +-
src/utils/services.ts | 29 +-
15 files changed, 1254 insertions(+), 226 deletions(-)
diff --git a/src/components/Breadcrumb.tsx b/src/components/Breadcrumb.tsx
index 1698452..cb124f4 100644
--- a/src/components/Breadcrumb.tsx
+++ b/src/components/Breadcrumb.tsx
@@ -21,7 +21,7 @@ export const Breadcrumb = ({ isChain }: BreadcrumbProps) => {
const breadcrumbItems = pathNames.map((path, index) => {
const isLast = index === pathNames.length - 1;
- const displayName = isChain && isLast ? chainData?.metadata?.chainName || path : path;
+ const displayName = isChain && isLast ? chainData?.metadata?.name || path : path;
const href = `/${pathNames.slice(0, index + 1).join('/')}`;
return {
diff --git a/src/components/ChainInformation.tsx b/src/components/ChainInformation.tsx
index e8f86b0..e1872f6 100644
--- a/src/components/ChainInformation.tsx
+++ b/src/components/ChainInformation.tsx
@@ -10,8 +10,8 @@ import ChainTypeDark from '~/assets/icons/chainTypeDark.svg';
import ChainTypeLight from '~/assets/icons/chainTypeLight.svg';
import CheckBlockDark from '~/assets/icons/checkBlockDark.svg';
import CheckBlockLight from '~/assets/icons/checkBlockLight.svg';
-import SpeedDark from '~/assets/icons/speedDark.svg';
-import SpeedLight from '~/assets/icons/speedLight.svg';
+// import SpeedDark from '~/assets/icons/speedDark.svg';
+// import SpeedLight from '~/assets/icons/speedLight.svg';
export const ChainInformation = () => {
const { t } = useTranslation();
@@ -32,7 +32,7 @@ export const ChainInformation = () => {
alt='chain-type-icon'
/>
- {
lightIcon={SpeedLight}
size={22}
alt='speed-icon'
- />
+ /> */}
{
alt='check-block'
/>
-
+ /> */}
);
diff --git a/src/components/ChainTable.tsx b/src/components/ChainTable.tsx
index cfd5091..ccb37bd 100644
--- a/src/components/ChainTable.tsx
+++ b/src/components/ChainTable.tsx
@@ -26,7 +26,7 @@ export const ChainTable = ({ chains }: TableProps) => {
const { t } = useTranslation();
const router = useRouter();
- const handleChainNavigation = (id: number) => {
+ const handleChainNavigation = (id: string) => {
router.push(`/${id}`);
};
@@ -51,19 +51,20 @@ export const ChainTable = ({ chains }: TableProps) => {
handleChainNavigation(data.chainId)}>
{/* Chain Name with Logo and Tags */}
-
- {data.chainName}
+
+ {data.metadata?.name ? data.metadata.name : `ZK Chain ${data.chainId}`}
+
{!data.rpc && }
- {!data.metadata && }
+ {data.metadata === undefined && }
{data.chainId}
-
- {data.nativeToken}
+
+ {data.baseToken.symbol}
{formatDataNumber(data.tvl, 0, true)}
@@ -146,16 +147,18 @@ export const STableCellHead = styled(TableCell)(() => {
};
});
-export const TableCellHeadFirst = styled(TableCell)(() => {
+export const TableCellHeadFirst = styled(TableCell)(({ theme }) => {
const { currentTheme } = useCustomTheme();
return {
color: currentTheme.textSecondary,
textAlign: 'left',
borderBottom: 'none',
- position: 'sticky',
- left: 0,
- zIndex: 1,
- backgroundColor: currentTheme.backgroundTertiary,
+ [theme.breakpoints.down('sm')]: {
+ position: 'sticky',
+ left: 0,
+ zIndex: 1,
+ backgroundColor: currentTheme.backgroundTertiary,
+ },
};
});
@@ -172,7 +175,7 @@ export const STableCell = styled(TableCell)(({ theme }) => {
};
});
-export const FirstCellWithLogo = styled(TableCell)(() => {
+export const FirstCellWithLogo = styled(TableCell)(({ theme }) => {
const { currentTheme } = useCustomTheme();
return {
color: currentTheme.textPrimary,
@@ -181,11 +184,13 @@ export const FirstCellWithLogo = styled(TableCell)(() => {
gap: currentTheme.gap,
border: 'none',
textAlign: 'left',
- position: 'sticky',
- left: 0,
- backgroundColor: currentTheme.backgroundSecondary,
- zIndex: 1,
minWidth: 'max-content',
+ [theme.breakpoints.down('sm')]: {
+ position: 'sticky',
+ left: 0,
+ backgroundColor: currentTheme.backgroundSecondary,
+ zIndex: 1,
+ },
};
});
diff --git a/src/components/RPC.tsx b/src/components/RPC.tsx
index 79283f1..bd5afd7 100644
--- a/src/components/RPC.tsx
+++ b/src/components/RPC.tsx
@@ -1,32 +1,52 @@
+import { useState, useEffect } from 'react';
import { useTranslation } from 'next-i18next';
import { Box, Typography, Tooltip, styled } from '@mui/material';
import { CheckCircle as CheckIcon, Cancel as CancelIcon } from '@mui/icons-material';
import { useData, useCustomTheme } from '~/hooks';
import { DataContainer, STitle } from '~/components';
+import { checkRpcStatus } from '~/utils';
export const RPC = () => {
const { t } = useTranslation();
const { chainData } = useData();
+ const [rpcData, setRpcData] = useState<{ url: string; status: boolean }[]>([]);
+
+ useEffect(() => {
+ const updateRpcStatuses = async () => {
+ if (!chainData?.metadata?.publicRpcs) return;
+
+ const updatedRpcData = await Promise.all(
+ chainData.metadata.publicRpcs.map(async (rpc) => {
+ const status = await checkRpcStatus(rpc);
+ return { url: rpc, status };
+ }),
+ );
+
+ setRpcData(updatedRpcData);
+ };
+
+ updateRpcStatuses();
+ }, [chainData]);
+
return (
{t('CHAIN.RPC.title')}
- {chainData?.metadata?.publicRpcs &&
- chainData.metadata.publicRpcs.map((rpc, index) => (
-
-
- {rpc.status ? : }
-
- {rpc.url}
-
- ))}
+ {rpcData.map((rpc, index) => (
+
+
+ {rpc.status ? : }
+
+ {rpc.url}
+
+ ))}
);
};
-export const RPCBox = styled(Box)(() => {
+const RPCBox = styled(Box)(() => {
const { currentTheme } = useCustomTheme();
return {
display: 'flex',
@@ -37,7 +57,7 @@ export const RPCBox = styled(Box)(() => {
};
});
-export const RPCUrl = styled(Typography)(() => {
+const RPCUrl = styled(Typography)(() => {
const { currentTheme } = useCustomTheme();
return {
textDecoration: 'underline',
diff --git a/src/components/TvlContentBox.tsx b/src/components/TvlContentBox.tsx
index b6aefac..b3eccc5 100644
--- a/src/components/TvlContentBox.tsx
+++ b/src/components/TvlContentBox.tsx
@@ -5,7 +5,7 @@ import { formatDataNumber } from '~/utils';
interface TvlContentBoxProps {
avatar: string;
token: string;
- total: number;
+ total: string;
tokenName: string;
isLast?: boolean;
}
diff --git a/src/containers/ChainDetail/ChainMetadata.tsx b/src/containers/ChainDetail/ChainMetadata.tsx
index 0f070a1..7eef2a7 100644
--- a/src/containers/ChainDetail/ChainMetadata.tsx
+++ b/src/containers/ChainDetail/ChainMetadata.tsx
@@ -1,5 +1,6 @@
import { Avatar, Box, Button, Typography, styled } from '@mui/material';
import { useTranslation } from 'next-i18next';
+import { useRouter } from 'next/router';
import Image from 'next/image';
import { useCustomTheme, useData } from '~/hooks';
@@ -20,6 +21,8 @@ import SettingsLight from '~/assets/icons/settingsLight.svg';
export const ChainMetadata = () => {
const { t } = useTranslation();
+ const router = useRouter();
+ const { chain } = router.query;
const { chainData } = useData();
const { theme } = useCustomTheme();
const data = chainData?.metadata;
@@ -29,17 +32,17 @@ export const ChainMetadata = () => {
-
+
- {data?.chainName}
+ {data?.name}
- {t('CHAIN.chainId')}: {data?.chainId}
+ {t('CHAIN.chainId')}: {chain}
-
+
{t('CHAIN.website')}
@@ -74,15 +77,15 @@ export const ChainMetadata = () => {
- {data?.environment}
+ {data?.chainType}
-
+
- {data?.nativeToken}
+ {data?.baseToken.symbol}
diff --git a/src/containers/Dashboard/index.tsx b/src/containers/Dashboard/index.tsx
index 70c1055..bab88cc 100644
--- a/src/containers/Dashboard/index.tsx
+++ b/src/containers/Dashboard/index.tsx
@@ -13,7 +13,7 @@ export const Dashboard = () => {
const chainIdStr = String(chain.chainId);
const formattedSearchTerm = String(searchTerm).toLowerCase();
- const matchesName = chain.chainName.toLowerCase().includes(formattedSearchTerm);
+ const matchesName = chain.metadata?.name.toLowerCase().includes(formattedSearchTerm);
const matchesId = chainIdStr.includes(formattedSearchTerm);
return matchesName || matchesId;
diff --git a/src/containers/LockedAssets/index.tsx b/src/containers/LockedAssets/index.tsx
index d5ad6c4..82d267e 100644
--- a/src/containers/LockedAssets/index.tsx
+++ b/src/containers/LockedAssets/index.tsx
@@ -83,6 +83,9 @@ const AllTokensButton = styled(Button)(() => {
fontSize: '0.75rem',
marginTop: '1.5rem',
alignItems: 'center',
+ '&:hover': {
+ backgroundColor: currentTheme.backgroundHover,
+ },
};
});
diff --git a/src/containers/Tokens/TokensTable.tsx b/src/containers/Tokens/TokensTable.tsx
index c2197b3..f28a743 100644
--- a/src/containers/Tokens/TokensTable.tsx
+++ b/src/containers/Tokens/TokensTable.tsx
@@ -43,7 +43,7 @@ export const TokensTable = ({ tvl }: TotalValueLockedProps) => {
${token.price.toLocaleString()}
- ${((token.amountUsd * token.price) / 1e18).toLocaleString()}
+ ${((Number(token.amountUsd) * Number(token.price)) / 1e18).toLocaleString()}
))}
diff --git a/src/data/chainMockData.json b/src/data/chainMockData.json
index abc22f3..75f881a 100644
--- a/src/data/chainMockData.json
+++ b/src/data/chainMockData.json
@@ -2,103 +2,569 @@
"chainType": "Rollup",
"tvl": [
{
- "symbol": "ETH",
+ "amount": "118098.529954744427197224",
+ "amountUsd": "298854234.9769785102439351932",
+ "price": "2530.55",
"name": "Ethereum",
- "amountUsd": 557596566000,
- "price": 3500,
- "imageUrl": "https://dynamic-assets.coinbase.com/dbb4b4983bde81309ddab83eb598358eb44375b930b94687ebe38bc22e52c3b2125258ffb8477a5ef22e33d6bd72e32a506c391caa13af64c00e46613c3e5806/asset_icons/4113b082d21cc5fab17fc8f2d19fb996165bcce635e6900f7fc2d57c4ef33ae9.png"
- },
- {
- "symbol": "USDT",
- "name": "Tether USD",
- "amountUsd": 114493849618,
- "price": 3500,
- "imageUrl": "https://www.cryptomkt.com/static/landing/img/crypto-pages/trending/usdt.svg"
+ "symbol": "ETH",
+ "contractAddress": null,
+ "type": "native",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
+ "decimals": 18
},
{
+ "amount": "55480860.508207",
+ "amountUsd": "55369898.787190586",
+ "price": "0.998",
+ "name": "USDC",
"symbol": "USDC",
- "name": "Bridged USD",
- "amountUsd": 34115209093,
- "price": 3500,
- "imageUrl": "https://assets.coingecko.com/coins/images/6319/standard/usdc.png?1696506694"
+ "contractAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694",
+ "type": "erc20",
+ "decimals": 6
},
{
+ "amount": "998459864.823799773445941598",
+ "amountUsd": "10983058.513061797507905357578",
+ "price": "0.011",
+ "name": "Koi",
"symbol": "KOI",
- "name": "Koi Finance",
- "amountUsd": 24115209093,
- "price": 3500,
- "imageUrl": "https://assets.coingecko.com/coins/images/35766/standard/Koi_logo.png?1709782399"
+ "contractAddress": "0x9D14BcE1dADdf408d77295BB1be9b343814f44DE",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/35766/large/Koi_logo.png?1709782399",
+ "type": "erc20",
+ "decimals": 18
},
{
- "symbol": "WBTC",
+ "amount": "9472627.999218",
+ "amountUsd": "9463155.371218782",
+ "price": "0.999",
+ "name": "Tether USD",
+ "symbol": "USDT",
+ "contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/325/large/Tether.png?1696501661",
+ "type": "erc20",
+ "decimals": 6
+ },
+ {
+ "amount": "110.93700914",
+ "amountUsd": "6317358.57275346784",
+ "price": "56945.456",
"name": "Wrapped BTC",
- "amountUsd": 12620248,
- "price": 3500,
- "imageUrl": "https://assets.coingecko.com/coins/images/7598/standard/wrapped_bitcoin_wbtc.png?1696507857"
+ "symbol": "WBTC",
+ "contractAddress": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/7598/large/wrapped_bitcoin_wbtc.png?1696507857",
+ "type": "erc20",
+ "decimals": 8
},
{
- "symbol": "wstETH",
- "name": "Lido wstETH",
- "amountUsd": 3552439,
- "price": 3500,
- "imageUrl": "https://assets.coingecko.com/coins/images/18834/standard/wstETH.png?1696518295"
+ "amount": "132452368.754496583511107126",
+ "amountUsd": "1854333.162562952169155499764",
+ "price": "0.014",
+ "name": "HYCO",
+ "symbol": "HYCO",
+ "contractAddress": "0x77F76483399Dc6328456105B1db23e2Aca455bf9",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/29407/large/coingecko_HYPERCOMIC_LOGO.png?1696528357",
+ "type": "erc20",
+ "decimals": 18
},
{
+ "amount": "47964958.588748853386740337",
+ "amountUsd": "959299.17177497706773480674",
+ "price": "0.02",
+ "name": "Idexo Token",
+ "symbol": "IDO",
+ "contractAddress": "0xF9c53268e9de692AE1b2ea5216E24e1c3ad7CB1E",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/18523/large/qOiqm7T8_400x400.jpg?1696518004",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "257.706060883787096756",
+ "amountUsd": "729164.610025205214406586908",
+ "price": "2829.443",
+ "name": "Rocket Pool ETH",
+ "symbol": "rETH",
+ "contractAddress": "0xae78736Cd615f374D3085123A210448E74Fc6393",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/20764/large/reth.png?1696520159",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "4597086.058830655172811988",
+ "amountUsd": "721742.511236412862131482116",
+ "price": "0.157",
+ "name": "DEXTF Token",
+ "symbol": "DEXTF",
+ "contractAddress": "0x5F64Ab1544D28732F0A24F4713c2C8ec0dA089f0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/12634/large/0qgT0aMu_400x400.jpg?1696512442",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "709393.663223743840780868",
+ "amountUsd": "706556.088570848865417744528",
+ "price": "0.996",
+ "name": "Dai Stablecoin",
+ "symbol": "DAI",
+ "contractAddress": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/9956/large/Badge_Dai.png?1696509996",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "3611649.325725586386626848",
+ "amountUsd": "274485.348755144565383640448",
+ "price": "0.076",
+ "name": "GOVI",
+ "symbol": "GOVI",
+ "contractAddress": "0xeEAA40B28A2d1b0B08f6f97bB1DD4B75316c6107",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13875/large/GOVI.png?1696513619",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "162910.961709234801235986",
+ "amountUsd": "162259.317862397862031042056",
+ "price": "0.996",
+ "name": "LUSD Stablecoin",
+ "symbol": "LUSD",
+ "contractAddress": "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/14666/large/Group_3.png?1696514341",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "769116.258069049173770643",
+ "amountUsd": "123827.717549116916977073523",
+ "price": "0.161",
+ "name": "Symbiosis",
+ "symbol": "SIS",
+ "contractAddress": "0xd38BB40815d2B0c2d2c866e0c72c5728ffC76dd9",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/20805/large/SymbiosisFinance_logo-150x150.jpeg?1696520198",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "34.07328120799622273",
+ "amountUsd": "93108.51193584564624710708",
+ "price": "2732.596",
+ "name": "Coinbase Wrapped Staked ETH",
"symbol": "cbETH",
- "name": "Curve cbETH",
- "amountUsd": 2552439,
- "price": 3500,
- "imageUrl": "https://assets.coingecko.com/coins/images/27008/standard/cbeth.png?1709186989"
+ "contractAddress": "0xBe9895146f7AF43049ca1c1AE358B0541Ea49704",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/27008/large/cbeth.png?1709186989",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1748294.875759738167409463",
+ "amountUsd": "54197.141148551883189693353",
+ "price": "0.031",
+ "name": "ZKBase",
+ "symbol": "ZKB",
+ "contractAddress": "0xBBBbbBBB46A1dA0F0C3F64522c275BAA4C332636",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13585/large/image_2024-01-16_172847810.png?1705397359",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "70230.481253590057712656",
+ "amountUsd": "42138.2887521540346275936",
+ "price": "0.6",
+ "name": "DeversiFi Token",
+ "symbol": "DVF",
+ "contractAddress": "0xDDdddd4301A082e62E84e43F474f044423921918",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/16414/large/rhinologo.png?1697736807",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "290.508016952",
+ "amountUsd": "40489.845370701952",
+ "price": "139.376",
+ "name": "Wrapped SOL (Wormhole)",
+ "symbol": "SOL",
+ "contractAddress": "0xD31a59c85aE9D8edEFeC411D448f90841571b89c",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/22876/large/SOL_wh_small.png?1696522175",
+ "type": "erc20",
+ "decimals": 9
+ },
+ {
+ "amount": "4069.036217336",
+ "amountUsd": "26216.800348295848",
+ "price": "6.443",
+ "name": "Wrapped TON Coin",
+ "symbol": "TONCOIN",
+ "contractAddress": "0x582d872A1B094FC48F5DE31D3B73F2D9bE47def1",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/17980/large/ton_symbol.png?1696517498",
+ "type": "erc20",
+ "decimals": 9
+ },
+ {
+ "amount": "23546.536039530998897252",
+ "amountUsd": "23522.989503491467898354748",
+ "price": "0.999",
+ "name": "Curve.Fi USD Stablecoin",
+ "symbol": "crvUSD",
+ "contractAddress": "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/30118/large/0xf939e0a03fb07f59a73314e73794be0e57ac1b4e.png?1721097561",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "8.989236054015567327",
+ "amountUsd": "22819.049873813761441646922",
+ "price": "2538.486",
+ "name": "Wrapped Ether",
+ "symbol": "WETH",
+ "contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/2518/large/weth.png?1696503332",
+ "type": "erc20",
+ "decimals": 18
},
{
- "symbol": "BAL",
- "name": "Balancer",
- "amountUsd": 1552439,
- "price": 3500,
- "imageUrl": "https://coin-images.coingecko.com/coins/images/671/large/balancer.png"
+ "amount": "6450474.040573841973953155",
+ "amountUsd": "19351.422121721525921859465",
+ "price": "0.003",
+ "name": "LSD Coin",
+ "symbol": "LSD",
+ "contractAddress": "0xfAC77A24E52B463bA9857d6b758ba41aE20e31FF",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/29519/large/logo.png?1696528462",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "5.423689884062204153",
+ "amountUsd": "16185.635689132864619181944",
+ "price": "2984.248",
+ "name": "Wrapped liquid staked Ether 2.0",
+ "symbol": "wstETH",
+ "contractAddress": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/18834/large/wstETH.png?1696518295",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "34056.984148728150579544",
+ "amountUsd": "13043.824928962881671965352",
+ "price": "0.383",
+ "name": "Bella",
+ "symbol": "BEL",
+ "contractAddress": "0xA91ac63D040dEB1b7A5E4d4134aD23eb0ba07e14",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/12478/large/Bella.png?1696512296",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "46220.536588230241212891",
+ "amountUsd": "11277.810927528178855945404",
+ "price": "0.244",
+ "name": "1INCH Token",
+ "symbol": "1INCH",
+ "contractAddress": "0x111111111117dC0aa78b770fA6A738034120C302",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13469/large/1inch-token.png?1696513230",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "563082.288758156473620986",
+ "amountUsd": "9009.316620130503577935776",
+ "price": "0.016",
+ "name": "Deri",
+ "symbol": "DERI",
+ "contractAddress": "0xA487bF43cF3b10dffc97A9A744cbB7036965d3b9",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13931/large/200vs200.jpg?1696513670",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "43034.765060388679856659",
+ "amountUsd": "7229.840530145298215918712",
+ "price": "0.168",
+ "name": "Maverick Token",
+ "symbol": "MAV",
+ "contractAddress": "0x7448c7456a97769F6cD04F1E83A4a23cCdC46aBD",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/30850/large/MAV_Logo.png?1696529701",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "4874.863543072452577322",
+ "amountUsd": "7195.298589574940004127272",
+ "price": "1.476",
+ "name": "Worldcoin",
+ "symbol": "WLD",
+ "contractAddress": "0x163f8C2467924be0ae7B5347228CABF260318753",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/31069/large/worldcoin.jpeg?1696529903",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1267111.79536025946087647",
+ "amountUsd": "6335.55897680129730438235",
+ "price": "0.005",
+ "name": "ZigZag",
+ "symbol": "ZZ",
+ "contractAddress": "0xC91a71A1fFA3d8B22ba615BA1B9c01b2BBBf55ad",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/26141/large/zig_zag.?1696525229",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.1",
+ "amountUsd": "5694.4497",
+ "price": "56944.497",
+ "name": "tBTC v2",
+ "symbol": "tBTC",
+ "contractAddress": "0x18084fbA666a33d37592fA2633fD49a74DD93a88",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/11224/large/0x18084fba666a33d37592fa2633fd49a74dd93a88.png?1696511155",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1.607308526702602644",
+ "amountUsd": "4152.653560748531109256908",
+ "price": "2583.607",
+ "name": "rsETH",
+ "symbol": "rsETH",
+ "contractAddress": "0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/33800/large/Icon___Dark.png?1702991855",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "35.167061181353626164",
+ "amountUsd": "3744.623841651715467568884",
+ "price": "106.481",
+ "name": "Aave Token",
+ "symbol": "AAVE",
+ "contractAddress": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/12645/large/aave-token-round.png?1720472354",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "312.082999060002117307",
+ "amountUsd": "3129.880397572761234471903",
+ "price": "10.029",
+ "name": "ChainLink Token",
+ "symbol": "LINK",
+ "contractAddress": "0x514910771AF9Ca656af840dff83E8264EcF986CA",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/877/large/chainlink-new-logo.png?1696502009",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "154.058620754243125866",
+ "amountUsd": "2757.803370121706196127266",
+ "price": "17.901",
+ "name": "Metaverse Index",
+ "symbol": "MVI",
+ "contractAddress": "0x72e364F2ABdC788b7E918bc238B21f109Cd634D7",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/14684/large/MVI_logo.png?1696514357",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "33",
+ "amountUsd": "1776.258",
+ "price": "53.826",
+ "name": "Tellor Tributes",
+ "symbol": "TRB",
+ "contractAddress": "0x88dF592F8eb5D7Bd38bFeF7dEb0fBc02cf3778a0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/9644/large/Blk_icon_current.png?1696509713",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.639944048220845643",
+ "amountUsd": "1646.186950090917565288056",
+ "price": "2572.392",
+ "name": "Renzo Restaked ETH",
+ "symbol": "Renzo Restaked ETH",
+ "contractAddress": "0xbf5495Efe5DB9ce00f80364C8B423567e58d2110",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/34753/large/Ezeth_logo_circle.png?1713496404",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "4093.979328418030008295",
+ "amountUsd": "1629.40377271037594330141",
+ "price": "0.398",
+ "name": "Matic Token",
+ "symbol": "MATIC",
+ "contractAddress": "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/4713/large/polygon.png?1698233745",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "132132.766491",
+ "amountUsd": "1189.194898419",
+ "price": "0.009",
+ "name": "Changer",
+ "symbol": "CNG",
+ "contractAddress": "0x5C1d9aA868a30795F92fAe903eDc9eFF269044bf",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/21786/large/cng.png?1696521140",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1164511.592541489082720882",
+ "amountUsd": "1164.511592541489082720882",
+ "price": "0.001",
+ "name": "Fringe",
+ "symbol": "FRIN",
+ "contractAddress": "0xC9fE6E1C76210bE83DC1B5b20ec7FD010B0b1D15",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13222/large/frin.png?1696513001",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "5985.542511355987510812",
+ "amountUsd": "861.918121635262201556928",
+ "price": "0.144",
+ "name": "WOO",
+ "symbol": "WOO",
+ "contractAddress": "0x4691937a7508860F876c9c0a2a617E7d9E945D4B",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/12921/large/WOO_Logos_2023_Profile_Pic_WOO.png?1696512709",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "134908.179074505869136306",
+ "amountUsd": "674.54089537252934568153",
+ "price": "0.005",
+ "name": "Furucombo",
+ "symbol": "COMBO",
+ "contractAddress": "0xfFffFffF2ba8F66D4e51811C5190992176930278",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13629/large/COMBO_token_ol.png?1696513377",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "51689.739780035047575291",
+ "amountUsd": "620.276877360420570903492",
+ "price": "0.012",
+ "name": "Beam",
+ "symbol": "BEAM",
+ "contractAddress": "0x62D0A8458eD7719FDAF978fe5929C6D342B0bFcE",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/32417/large/chain-logo.png?1698114384",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.201",
+ "amountUsd": "528.814518",
+ "price": "2630.918",
+ "name": "mETH",
+ "symbol": "mETH",
+ "contractAddress": "0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/33345/large/symbol_transparent_bg.png?1701697066",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "42.412842071038840242",
+ "amountUsd": "447.837199428099114115278",
+ "price": "10.559",
+ "name": "Rocket Pool",
+ "symbol": "RPL",
+ "contractAddress": "0xD33526068D116cE69F19A9ee46F0bd304F21A51f",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/2090/large/rocket_pool_%28RPL%29.png?1696503058",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "97739",
+ "amountUsd": "293.217",
+ "price": "0.003",
+ "name": "Bonsai3",
+ "symbol": "SEED",
+ "contractAddress": "0xe2353069f71a27bBbe66eEabfF05dE109c7d5E19",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/33162/large/logo-bonsai3200x200.png?1700830408",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.000014110846294792",
+ "amountUsd": "0.000004952907049471992",
+ "price": "0.351",
+ "name": "Storj",
+ "symbol": "STORJ",
+ "contractAddress": "0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/949/large/storj.png?1696502065",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "15945307297.038027211009518403",
+ "amountUsd": "0",
+ "price": "0",
+ "name": "Pepe",
+ "symbol": "PEPE",
+ "contractAddress": "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/29850/large/pepe-token.jpeg?1696528776",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1073815923.25847686794945247",
+ "amountUsd": "0",
+ "price": "0",
+ "name": "SHIBA INU",
+ "symbol": "SHIB",
+ "contractAddress": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/11939/large/shiba.png?1696511800",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.048392888467075907",
+ "amountUsd": "0",
+ "price": "0",
+ "name": "Syncus",
+ "symbol": "SYNC",
+ "contractAddress": "0xa41d2f8Ee4F47D3B860A149765A7dF8c3287b7F0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/33573/large/Syncus.png?1702450708",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "10000100",
+ "amountUsd": "0",
+ "price": "0",
+ "name": "XWG",
+ "symbol": "XWG",
+ "contractAddress": "0x0a77eF9bf662D62Fbf9BA4cf861EaA83F9CC4FEC",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/17847/large/200_200_%281%29_%281%29.png?1696790226",
+ "type": "erc20",
+ "decimals": 18
}
],
- "batchesInfo": {
- "commited": 100,
- "verified": 90,
- "executed": 80
- },
+ "batchesInfo": { "commited": "490872", "verified": "490869", "executed": "490825" },
"feeParams": {
- "batchOverheadL1Gas": 50000,
+ "batchOverheadL1Gas": 1000000,
+ "maxL2GasPerBatch": 80000000,
"maxPubdataPerBatch": 120000,
- "maxL2GasPerBatch": 10000000,
- "priorityTxMaxPubdata": 15000,
- "minimalL2GasPrice": 0.25
+ "minimalL2GasPrice": "250000000",
+ "priorityTxMaxPubdata": 99000
},
"metadata": {
+ "name": "ZKsyncERA",
"iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png",
- "chainName": "ZKsyncERA",
- "chainId": "324",
- "publicRpcs": [
- {
- "url": "https://mainnet.era.zksync.io",
- "status": true
- },
- {
- "url": "https://1rpc.io/zksync2-era",
- "status": true
- },
- {
- "url": "https://zksync.drpc.org",
- "status": false
- }
- ],
- "websiteUrl": "https://zksync.io/",
+ "publicRpcs": ["https://mainnet.era.zksync.io", "https://zksync.drpc.org", "https://zksync.meowrpc.com"],
"explorerUrl": "https://explorer.zksync.io/",
"launchDate": 1679626800,
- "environment": "mainnet",
- "nativeTokenIconUrl": "https://dynamic-assets.coinbase.com/dbb4b4983bde81309ddab83eb598358eb44375b930b94687ebe38bc22e52c3b2125258ffb8477a5ef22e33d6bd72e32a506c391caa13af64c00e46613c3e5806/asset_icons/4113b082d21cc5fab17fc8f2d19fb996165bcce635e6900f7fc2d57c4ef33ae9.png",
- "nativeToken": "ETH"
- },
- "l2ChainInfo": {
- "tps": 10000000,
- "avgBlockTime": 12,
- "lastBlock": 1000000,
- "lastBlockVerified": 999999
+ "chainType": "Rollup",
+ "baseToken": {
+ "name": "Ethereum",
+ "symbol": "ETH",
+ "contractAddress": null,
+ "coingeckoId": "ethereum",
+ "type": "native",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
+ "decimals": 18
+ },
+ "tokenImgUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628"
}
}
diff --git a/src/data/ecosystemMockData.json b/src/data/ecosystemMockData.json
index 4ba4094..d4200d3 100644
--- a/src/data/ecosystemMockData.json
+++ b/src/data/ecosystemMockData.json
@@ -1,110 +1,589 @@
{
"l1Tvl": [
{
- "symbol": "ETH",
+ "amount": "118306.55939191423985395",
+ "amountUsd": "300833113.49886311078510011665",
+ "price": "2542.827",
"name": "Ethereum",
- "amountUsd": 557596566000,
- "price": 300,
- "imageUrl": "https://dynamic-assets.coinbase.com/dbb4b4983bde81309ddab83eb598358eb44375b930b94687ebe38bc22e52c3b2125258ffb8477a5ef22e33d6bd72e32a506c391caa13af64c00e46613c3e5806/asset_icons/4113b082d21cc5fab17fc8f2d19fb996165bcce635e6900f7fc2d57c4ef33ae9.png"
- },
- {
- "symbol": "USDT",
- "name": "Tether USD",
- "amountUsd": 114493849618,
- "price": 300,
- "imageUrl": "https://www.cryptomkt.com/static/landing/img/crypto-pages/trending/usdt.svg"
+ "symbol": "ETH",
+ "contractAddress": null,
+ "type": "native",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
+ "decimals": 18
},
{
+ "amount": "56310048.030096",
+ "amountUsd": "56366358.078126096",
+ "price": "1.001",
+ "name": "USDC",
"symbol": "USDC",
- "name": "Bridged USD",
- "amountUsd": 34115209093,
- "price": 300,
- "imageUrl": "https://assets.coingecko.com/coins/images/6319/standard/usdc.png?1696506694"
+ "contractAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694",
+ "type": "erc20",
+ "decimals": 6
},
{
+ "amount": "998459864.823799773445941598",
+ "amountUsd": "11981518.377885597281351299176",
+ "price": "0.012",
+ "name": "Koi",
"symbol": "KOI",
- "name": "Koi Finance",
- "amountUsd": 24115209093,
- "price": 300,
- "imageUrl": "https://assets.coingecko.com/coins/images/35766/standard/Koi_logo.png?1709782399"
+ "contractAddress": "0x9D14BcE1dADdf408d77295BB1be9b343814f44DE",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/35766/large/Koi_logo.png?1709782399",
+ "type": "erc20",
+ "decimals": 18
},
{
- "symbol": "WBTC",
+ "amount": "9472627.999218",
+ "amountUsd": "9482100.627217218",
+ "price": "1.001",
+ "name": "Tether USD",
+ "symbol": "USDT",
+ "contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/325/large/Tether.png?1696501661",
+ "type": "erc20",
+ "decimals": 6
+ },
+ {
+ "amount": "113.67749192",
+ "amountUsd": "6457843.93470259472",
+ "price": "56808.466",
"name": "Wrapped BTC",
- "amountUsd": 12620248,
- "price": 300,
- "imageUrl": "https://assets.coingecko.com/coins/images/7598/standard/wrapped_bitcoin_wbtc.png?1696507857"
+ "symbol": "WBTC",
+ "contractAddress": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/7598/large/wrapped_bitcoin_wbtc.png?1696507857",
+ "type": "erc20",
+ "decimals": 8
},
{
- "symbol": "wstETH",
- "name": "Lido wstETH",
- "amountUsd": 3552439,
- "price": 300,
- "imageUrl": "https://assets.coingecko.com/coins/images/18834/standard/wstETH.png?1696518295"
+ "amount": "132452368.754496583511107126",
+ "amountUsd": "1721880.793808455585644392638",
+ "price": "0.013",
+ "name": "HYCO",
+ "symbol": "HYCO",
+ "contractAddress": "0x77F76483399Dc6328456105B1db23e2Aca455bf9",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/29407/large/coingecko_HYPERCOMIC_LOGO.png?1696528357",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "47964958.588748853386740337",
+ "amountUsd": "1007264.130363725921121547077",
+ "price": "0.021",
+ "name": "Idexo Token",
+ "symbol": "IDO",
+ "contractAddress": "0xF9c53268e9de692AE1b2ea5216E24e1c3ad7CB1E",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/18523/large/qOiqm7T8_400x400.jpg?1696518004",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "257.706060883787096756",
+ "amountUsd": "730177.652550539381483934744",
+ "price": "2833.374",
+ "name": "Rocket Pool ETH",
+ "symbol": "rETH",
+ "contractAddress": "0xae78736Cd615f374D3085123A210448E74Fc6393",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/20764/large/reth.png?1696520159",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "4597086.058830655172811988",
+ "amountUsd": "717145.425177582206958670128",
+ "price": "0.156",
+ "name": "DEXTF Token",
+ "symbol": "DEXTF",
+ "contractAddress": "0x5F64Ab1544D28732F0A24F4713c2C8ec0dA089f0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/12634/large/0qgT0aMu_400x400.jpg?1696512442",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "709393.663223743840780868",
+ "amountUsd": "709393.663223743840780868",
+ "price": "1",
+ "name": "Dai Stablecoin",
+ "symbol": "DAI",
+ "contractAddress": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/9956/large/Badge_Dai.png?1696509996",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "3611649.325725586386626848",
+ "amountUsd": "274485.348755144565383640448",
+ "price": "0.076",
+ "name": "GOVI",
+ "symbol": "GOVI",
+ "contractAddress": "0xeEAA40B28A2d1b0B08f6f97bB1DD4B75316c6107",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13875/large/GOVI.png?1696513619",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "162910.961709234801235986",
+ "amountUsd": "162585.139785816331633514028",
+ "price": "0.998",
+ "name": "LUSD Stablecoin",
+ "symbol": "LUSD",
+ "contractAddress": "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/14666/large/Group_3.png?1696514341",
+ "type": "erc20",
+ "decimals": 18
},
{
+ "amount": "769116.258069049173770643",
+ "amountUsd": "123827.717549116916977073523",
+ "price": "0.161",
+ "name": "Symbiosis",
+ "symbol": "SIS",
+ "contractAddress": "0xd38BB40815d2B0c2d2c866e0c72c5728ffC76dd9",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/20805/large/SymbiosisFinance_logo-150x150.jpeg?1696520198",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "34.07328120799622273",
+ "amountUsd": "93326.64908213923806502454",
+ "price": "2738.998",
+ "name": "Coinbase Wrapped Staked ETH",
"symbol": "cbETH",
- "name": "Curve cbETH",
- "amountUsd": 2552439,
- "price": 300,
- "imageUrl": "https://assets.coingecko.com/coins/images/27008/standard/cbeth.png?1709186989"
+ "contractAddress": "0xBe9895146f7AF43049ca1c1AE358B0541Ea49704",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/27008/large/cbeth.png?1709186989",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1748294.875759738167409463",
+ "amountUsd": "54197.141148551883189693353",
+ "price": "0.031",
+ "name": "ZKBase",
+ "symbol": "ZKB",
+ "contractAddress": "0xBBBbbBBB46A1dA0F0C3F64522c275BAA4C332636",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13585/large/image_2024-01-16_172847810.png?1705397359",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "70230.481253590057712656",
+ "amountUsd": "42138.2887521540346275936",
+ "price": "0.6",
+ "name": "DeversiFi Token",
+ "symbol": "DVF",
+ "contractAddress": "0xDDdddd4301A082e62E84e43F474f044423921918",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/16414/large/rhinologo.png?1697736807",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "290.508016952",
+ "amountUsd": "40900.62370667208",
+ "price": "140.79",
+ "name": "Wrapped SOL (Wormhole)",
+ "symbol": "SOL",
+ "contractAddress": "0xD31a59c85aE9D8edEFeC411D448f90841571b89c",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/22876/large/SOL_wh_small.png?1696522175",
+ "type": "erc20",
+ "decimals": 9
+ },
+ {
+ "amount": "4028.076528447",
+ "amountUsd": "26339.592419514933",
+ "price": "6.539",
+ "name": "Wrapped TON Coin",
+ "symbol": "TONCOIN",
+ "contractAddress": "0x582d872A1B094FC48F5DE31D3B73F2D9bE47def1",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/17980/large/ton_symbol.png?1696517498",
+ "type": "erc20",
+ "decimals": 9
+ },
+ {
+ "amount": "23546.536039530998897252",
+ "amountUsd": "23570.082575570529896149252",
+ "price": "1.001",
+ "name": "Curve.Fi USD Stablecoin",
+ "symbol": "crvUSD",
+ "contractAddress": "0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/30118/large/0xf939e0a03fb07f59a73314e73794be0e57ac1b4e.png?1721097561",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "8.989236054015567327",
+ "amountUsd": "22847.294053495478354188356",
+ "price": "2541.628",
+ "name": "Wrapped Ether",
+ "symbol": "WETH",
+ "contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/2518/large/weth.png?1696503332",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "6450474.040573841973953155",
+ "amountUsd": "19351.422121721525921859465",
+ "price": "0.003",
+ "name": "LSD Coin",
+ "symbol": "LSD",
+ "contractAddress": "0xfAC77A24E52B463bA9857d6b758ba41aE20e31FF",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/29519/large/logo.png?1696528462",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "5.423689884062204153",
+ "amountUsd": "16213.876842359176516206615",
+ "price": "2989.455",
+ "name": "Wrapped liquid staked Ether 2.0",
+ "symbol": "wstETH",
+ "contractAddress": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/18834/large/wstETH.png?1696518295",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "34056.984148728150579544",
+ "amountUsd": "13009.767944814153521385808",
+ "price": "0.382",
+ "name": "Bella",
+ "symbol": "BEL",
+ "contractAddress": "0xA91ac63D040dEB1b7A5E4d4134aD23eb0ba07e14",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/12478/large/Bella.png?1696512296",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "46220.536588230241212891",
+ "amountUsd": "11324.031464116409097158295",
+ "price": "0.245",
+ "name": "1INCH Token",
+ "symbol": "1INCH",
+ "contractAddress": "0x111111111117dC0aa78b770fA6A738034120C302",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13469/large/1inch-token.png?1696513230",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "563082.288758156473620986",
+ "amountUsd": "9009.316620130503577935776",
+ "price": "0.016",
+ "name": "Deri",
+ "symbol": "DERI",
+ "contractAddress": "0xA487bF43cF3b10dffc97A9A744cbB7036965d3b9",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13931/large/200vs200.jpg?1696513670",
+ "type": "erc20",
+ "decimals": 18
},
{
- "symbol": "BAL",
- "name": "Balancer",
- "amountUsd": 1552439,
- "price": 300,
- "imageUrl": "https://coin-images.coingecko.com/coins/images/671/large/balancer.png"
+ "amount": "43034.765060388679856659",
+ "amountUsd": "7315.91006026607557563203",
+ "price": "0.17",
+ "name": "Maverick Token",
+ "symbol": "MAV",
+ "contractAddress": "0x7448c7456a97769F6cD04F1E83A4a23cCdC46aBD",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/30850/large/MAV_Logo.png?1696529701",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "4874.863543072452577322",
+ "amountUsd": "7244.047225005664529900492",
+ "price": "1.486",
+ "name": "Worldcoin",
+ "symbol": "WLD",
+ "contractAddress": "0x163f8C2467924be0ae7B5347228CABF260318753",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/31069/large/worldcoin.jpeg?1696529903",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1267111.79536025946087647",
+ "amountUsd": "6335.55897680129730438235",
+ "price": "0.005",
+ "name": "ZigZag",
+ "symbol": "ZZ",
+ "contractAddress": "0xC91a71A1fFA3d8B22ba615BA1B9c01b2BBBf55ad",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/26141/large/zig_zag.?1696525229",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.1",
+ "amountUsd": "5675.4499",
+ "price": "56754.499",
+ "name": "tBTC v2",
+ "symbol": "tBTC",
+ "contractAddress": "0x18084fbA666a33d37592fA2633fD49a74DD93a88",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/11224/large/0x18084fba666a33d37592fa2633fd49a74dd93a88.png?1696511155",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1.607308526702602644",
+ "amountUsd": "4156.075520601880950285984",
+ "price": "2585.736",
+ "name": "rsETH",
+ "symbol": "rsETH",
+ "contractAddress": "0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/33800/large/Icon___Dark.png?1702991855",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "35.167061181353626164",
+ "amountUsd": "3755.806967107385920689036",
+ "price": "106.799",
+ "name": "Aave Token",
+ "symbol": "AAVE",
+ "contractAddress": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/12645/large/aave-token-round.png?1720472354",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "312.082999060002117307",
+ "amountUsd": "3143.299966532341325516104",
+ "price": "10.072",
+ "name": "ChainLink Token",
+ "symbol": "LINK",
+ "contractAddress": "0x514910771AF9Ca656af840dff83E8264EcF986CA",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/877/large/chainlink-new-logo.png?1696502009",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "154.058620754243125866",
+ "amountUsd": "2615.91538040704827720468",
+ "price": "16.98",
+ "name": "Metaverse Index",
+ "symbol": "MVI",
+ "contractAddress": "0x72e364F2ABdC788b7E918bc238B21f109Cd634D7",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/14684/large/MVI_logo.png?1696514357",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "33",
+ "amountUsd": "1821.369",
+ "price": "55.193",
+ "name": "Tellor Tributes",
+ "symbol": "TRB",
+ "contractAddress": "0x88dF592F8eb5D7Bd38bFeF7dEb0fBc02cf3778a0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/9644/large/Blk_icon_current.png?1696509713",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.639944048220845643",
+ "amountUsd": "1651.358977888638439774782",
+ "price": "2580.474",
+ "name": "Renzo Restaked ETH",
+ "symbol": "Renzo Restaked ETH",
+ "contractAddress": "0xbf5495Efe5DB9ce00f80364C8B423567e58d2110",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/34753/large/Ezeth_logo_circle.png?1713496404",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "4093.979328418030008295",
+ "amountUsd": "1633.497752038793973309705",
+ "price": "0.399",
+ "name": "Matic Token",
+ "symbol": "MATIC",
+ "contractAddress": "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/4713/large/polygon.png?1698233745",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "132132.766491",
+ "amountUsd": "1189.194898419",
+ "price": "0.009",
+ "name": "Changer",
+ "symbol": "CNG",
+ "contractAddress": "0x5C1d9aA868a30795F92fAe903eDc9eFF269044bf",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/21786/large/cng.png?1696521140",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1164511.592541489082720882",
+ "amountUsd": "1164.511592541489082720882",
+ "price": "0.001",
+ "name": "Fringe",
+ "symbol": "FRIN",
+ "contractAddress": "0xC9fE6E1C76210bE83DC1B5b20ec7FD010B0b1D15",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13222/large/frin.png?1696513001",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "5985.542511355987510812",
+ "amountUsd": "867.90366414661818906774",
+ "price": "0.145",
+ "name": "WOO",
+ "symbol": "WOO",
+ "contractAddress": "0x4691937a7508860F876c9c0a2a617E7d9E945D4B",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/12921/large/WOO_Logos_2023_Profile_Pic_WOO.png?1696512709",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "134908.179074505869136306",
+ "amountUsd": "674.54089537252934568153",
+ "price": "0.005",
+ "name": "Furucombo",
+ "symbol": "COMBO",
+ "contractAddress": "0xfFffFffF2ba8F66D4e51811C5190992176930278",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/13629/large/COMBO_token_ol.png?1696513377",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "51689.739780035047575291",
+ "amountUsd": "620.276877360420570903492",
+ "price": "0.012",
+ "name": "Beam",
+ "symbol": "BEAM",
+ "contractAddress": "0x62D0A8458eD7719FDAF978fe5929C6D342B0bFcE",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/32417/large/chain-logo.png?1698114384",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.201",
+ "amountUsd": "532.432317",
+ "price": "2648.917",
+ "name": "mETH",
+ "symbol": "mETH",
+ "contractAddress": "0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/33345/large/symbol_transparent_bg.png?1701697066",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "42.412842071038840242",
+ "amountUsd": "442.15387859057990952285",
+ "price": "10.425",
+ "name": "Rocket Pool",
+ "symbol": "RPL",
+ "contractAddress": "0xD33526068D116cE69F19A9ee46F0bd304F21A51f",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/2090/large/rocket_pool_%28RPL%29.png?1696503058",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "97739",
+ "amountUsd": "293.217",
+ "price": "0.003",
+ "name": "Bonsai3",
+ "symbol": "SEED",
+ "contractAddress": "0xe2353069f71a27bBbe66eEabfF05dE109c7d5E19",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/33162/large/logo-bonsai3200x200.png?1700830408",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.000014104615563706",
+ "amountUsd": "0.000004950720062860806",
+ "price": "0.351",
+ "name": "Storj",
+ "symbol": "STORJ",
+ "contractAddress": "0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/949/large/storj.png?1696502065",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "15945307297.038027211009518403",
+ "amountUsd": "0",
+ "price": "0",
+ "name": "Pepe",
+ "symbol": "PEPE",
+ "contractAddress": "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/29850/large/pepe-token.jpeg?1696528776",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "1073815923.25847686794945247",
+ "amountUsd": "0",
+ "price": "0",
+ "name": "SHIBA INU",
+ "symbol": "SHIB",
+ "contractAddress": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/11939/large/shiba.png?1696511800",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "0.048392888467075907",
+ "amountUsd": "0",
+ "price": "0",
+ "name": "Syncus",
+ "symbol": "SYNC",
+ "contractAddress": "0xa41d2f8Ee4F47D3B860A149765A7dF8c3287b7F0",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/33573/large/Syncus.png?1702450708",
+ "type": "erc20",
+ "decimals": 18
+ },
+ {
+ "amount": "10000100",
+ "amountUsd": "0",
+ "price": "0",
+ "name": "XWG",
+ "symbol": "XWG",
+ "contractAddress": "0x0a77eF9bf662D62Fbf9BA4cf861EaA83F9CC4FEC",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/17847/large/200_200_%281%29_%281%29.png?1696790226",
+ "type": "erc20",
+ "decimals": 18
}
],
- "ethGasInfo": {
- "gasPrice": 50,
- "ethTransfer": 21000,
- "erc20Transfer": 65000
- },
+ "ethGasInfo": { "gasPrice": "2811768091", "erc20Transfer": "34853", "ethTransfer": "21000" },
"zkChains": [
{
- "chainId": 0,
- "chainName": "ZKsyncERA",
- "iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png",
+ "chainId": "324",
"chainType": "Rollup",
- "nativeToken": "ETH",
- "tokenImgUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
- "tvl": 1000000,
- "metadata": true,
- "rpc": true
- },
- {
- "chainId": 1,
- "chainName": "ZKsyncERA",
- "iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png",
- "chainType": "Validium",
- "nativeToken": "ETH",
- "tokenImgUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
- "tvl": 500000,
- "metadata": true,
+ "baseToken": {
+ "name": "Ethereum",
+ "symbol": "ETH",
+ "contractAddress": null,
+ "coingeckoId": "ethereum",
+ "type": "native",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
+ "decimals": 18
+ },
+ "tvl": "389188998.253667604685659703935",
+ "metadata": {
+ "iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png",
+ "name": "ZKsyncERA",
+ "publicRpcs": ["https://mainnet.era.zksync.io", "https://zksync.drpc.org", "https://zksync.meowrpc.com"],
+ "explorerUrl": "https://explorer.zksync.io/",
+ "launchDate": 1679626800
+ },
"rpc": false
},
{
- "chainId": 2,
- "chainName": "ZKsyncERA",
- "iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png",
- "chainType": "Rollup",
- "nativeToken": "ETH",
- "tokenImgUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
- "tvl": 300000,
- "metadata": false,
- "rpc": true
- },
- {
- "chainId": 3,
- "chainName": "ZKsyncERA",
- "iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png",
+ "chainId": "388",
"chainType": "Rollup",
- "nativeToken": "ETH",
- "tokenImgUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
- "tvl": 10000,
- "metadata": false,
+ "baseToken": {
+ "name": "Ethereum",
+ "symbol": "ETH",
+ "contractAddress": null,
+ "coingeckoId": "ethereum",
+ "type": "native",
+ "imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628",
+ "decimals": 18
+ },
+ "tvl": "1802056.74192740728",
+ "metadata": {
+ "iconUrl": "https://s3.coinmarketcap.com/static-gravity/image/84e1ec1257dd4a6da6ee5584338a2460.jpeg",
+ "name": "Cronos",
+ "publicRpcs": ["https://mainnet.zkevm.cronos.org"],
+ "explorerUrl": "https://explorer.zkevm.cronos.org/",
+ "launchDate": 1679626800
+ },
"rpc": false
}
]
diff --git a/src/pages/[chain]/index.tsx b/src/pages/[chain]/index.tsx
index 1dcbc6e..64520eb 100644
--- a/src/pages/[chain]/index.tsx
+++ b/src/pages/[chain]/index.tsx
@@ -19,13 +19,16 @@ const Chain = ({ chain }: InferGetStaticPropsType) => {
const { setSelectedChainId, refetchChainData } = useData();
useEffect(() => {
- setSelectedChainId(chain?.chainId);
+ if (chain.chainId) {
+ setSelectedChainId(chain.chainId);
+ }
+
refetchChainData({ throwOnError: true, cancelRefetch: false });
}, [chain?.chainId, setSelectedChainId, refetchChainData]);
return (
<>
-
+
>
);
@@ -48,7 +51,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
export const getStaticProps: GetStaticProps = async ({ params, locale }: GetStaticPropsContext) => {
const ecosystemData = await fetchEcosystemData();
const chains = ecosystemData.zkChains;
- const chainId = parseInt(params?.chain as string);
+ const chainId = params?.chain;
const chain = chains.find((chain: EcosystemChainData) => chain.chainId === chainId);
if (!chain) {
diff --git a/src/providers/DataProvider.tsx b/src/providers/DataProvider.tsx
index d2b2ff3..2256964 100644
--- a/src/providers/DataProvider.tsx
+++ b/src/providers/DataProvider.tsx
@@ -6,8 +6,8 @@ import { ChainData, EcosystemData, TvlData } from '~/types';
import { fetchEcosystemData, fetchChainData } from '~/utils';
type ContextType = {
- selectedChainId?: number;
- setSelectedChainId: (val: number) => void;
+ selectedChainId?: string;
+ setSelectedChainId: (val: string) => void;
isEcosystemLoading: boolean;
isChainLoading: boolean;
@@ -26,7 +26,7 @@ interface DataProps {
export const DataContext = createContext({} as ContextType);
export const DataProvider = ({ children }: DataProps) => {
- const [selectedChainId, setSelectedChainId] = useState();
+ const [selectedChainId, setSelectedChainId] = useState();
const router = useRouter();
const {
@@ -45,8 +45,14 @@ export const DataProvider = ({ children }: DataProps) => {
refetch: refetchChainData,
} = useQuery({
queryKey: ['chainData', selectedChainId],
- queryFn: () => fetchChainData(selectedChainId!),
- enabled: !!selectedChainId,
+ queryFn: () => {
+ if (selectedChainId) {
+ return fetchChainData(selectedChainId);
+ } else {
+ return Promise.resolve(undefined);
+ }
+ },
+ enabled: !!selectedChainId, // Only fetch chain data if selectedChainId is defined
});
useEffect(() => {
@@ -56,7 +62,7 @@ export const DataProvider = ({ children }: DataProps) => {
}, [isEcosystemError, isChainError, router]);
const totalL1TVL = (ecosystemData?.l1Tvl || []).reduce((accumulator: number, token: TvlData) => {
- return accumulator + (token.amountUsd || 0);
+ return accumulator + (Number(token.amountUsd) || 0);
}, 0);
return (
diff --git a/src/types/Data.ts b/src/types/Data.ts
index 22aff46..4accd68 100644
--- a/src/types/Data.ts
+++ b/src/types/Data.ts
@@ -11,22 +11,25 @@ export interface ChainData {
maxPubdataPerBatch: number;
maxL2GasPerBatch: number;
priorityTxMaxPubdata: number;
- minimalL2GasPrice: number;
+ minimalL2GasPrice: string;
};
metadata: {
+ name: string;
iconUrl: string;
- chainName: string;
- chainId: number;
- publicRpcs: {
- url: string;
- status: boolean;
- }[];
- websiteUrl: string;
+ publicRpcs: string[];
explorerUrl: string;
launchDate: number;
- environment: string;
- nativeTokenIconUrl: string;
- nativeToken: string;
+ chainType: string;
+ baseToken: {
+ name: string;
+ symbol: string;
+ contractAddress: string | null;
+ coingeckoId: string;
+ type: string;
+ imageUrl: string;
+ decimals: number;
+ };
+ tokenImgUrl: string;
};
l2ChainInfo: {
tps: number;
@@ -37,14 +40,25 @@ export interface ChainData {
}
export interface EcosystemChainData {
- chainName: string;
- chainId: number;
- iconUrl: string;
- nativeToken: string;
- tokenImgUrl: string;
- tvl: number;
+ chainId: string;
chainType: string;
- metadata: boolean;
+ baseToken: {
+ name: string;
+ symbol: string;
+ contractAddress: string | null;
+ coingeckoId: string;
+ type: string;
+ imageUrl: string;
+ decimals: 18;
+ };
+ tvl: string;
+ metadata?: {
+ iconUrl: string;
+ name: string;
+ publicRpcs: string[];
+ explorerUrl: string;
+ launchDate: number;
+ };
rpc: boolean;
}
@@ -59,11 +73,15 @@ export interface EcosystemData {
}
export interface TvlData {
- symbol: string;
+ amount: string;
+ amountUsd: string;
+ price: string;
name: string;
- amountUsd: number;
- price: number;
+ symbol: string;
+ contractAddress: string | null;
+ type: string;
imageUrl: string;
+ decimals: number;
}
export interface ChainTvl {
diff --git a/src/utils/services.ts b/src/utils/services.ts
index b4da13c..0ea19aa 100644
--- a/src/utils/services.ts
+++ b/src/utils/services.ts
@@ -21,15 +21,40 @@ export const fetchEcosystemData = async () => {
return await res.json();
};
-export const fetchChainData = async (chainId: number) => {
+export const fetchChainData = async (chainId: string) => {
// temporary for mock data
if (!API_URL) {
await delay(2000); // Simulate 2 seconds delay
return Promise.resolve(chainMockData);
}
- const res = await fetch(`${API_URL}/zkchain/${chainId}`);
+ const res = await fetch(`${API_URL}/metrics/zkchain/${chainId}`);
if (!res.ok) {
throw new Error('Failed to fetch chain data');
}
return await res.json();
};
+
+export async function checkRpcStatus(rpcUrl: string): Promise {
+ try {
+ // Ping the RPC endpoint with a basic request
+ const response = await fetch(rpcUrl, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ jsonrpc: '2.0',
+ id: 1,
+ method: 'web3_clientVersion', // A basic method that should be supported by most RPC endpoints
+ params: [],
+ }),
+ });
+
+ // If the response is successful and contains a valid result, return true
+ const data = await response.json();
+ return response.ok && !!data.result;
+ } catch (error) {
+ // If there is an error or the endpoint is not responding, return false
+ return false;
+ }
+}