From 7e461f489cbcfa1079b62298fe51ebca07d3db92 Mon Sep 17 00:00:00 2001 From: Kevin Peters Date: Fri, 25 Feb 2022 18:33:26 +0000 Subject: [PATCH] bridge_ui: tvl chain name fix --- bridge_ui/src/hooks/useTVL.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridge_ui/src/hooks/useTVL.ts b/bridge_ui/src/hooks/useTVL.ts index 64a51fa41..2181890b1 100644 --- a/bridge_ui/src/hooks/useTVL.ts +++ b/bridge_ui/src/hooks/useTVL.ts @@ -8,7 +8,7 @@ import { receiveDataWrapper, } from "../store/helpers"; import { COIN_GECKO_IMAGE_URLS } from "../utils/coinGecko"; -import { TVL_URL } from "../utils/consts"; +import { CHAINS_BY_ID, TVL_URL } from "../utils/consts"; export type TVL = { logo?: string; @@ -50,6 +50,8 @@ const createTVLArray = (notionalTvl: NotionalTvl) => { const tvl: TVL[] = []; for (const [chainId, chainAssets] of Object.entries(notionalTvl.AllTime)) { if (chainId === "*") continue; + const originChainId = +chainId as ChainId; + const originChain = CHAINS_BY_ID[originChainId].name; for (const [tokenAddress, lockedAsset] of Object.entries(chainAssets)) { if (tokenAddress === "*") continue; tvl.push({ @@ -60,8 +62,8 @@ const createTVLArray = (notionalTvl: NotionalTvl) => { totalValue: lockedAsset.Notional, quotePrice: lockedAsset.TokenPrice, assetAddress: tokenAddress, - originChainId: +chainId as ChainId, - originChain: chainId.toString(), + originChainId, + originChain, }); } }