bridge_ui: tvl chain name fix

This commit is contained in:
Kevin Peters 2022-02-25 18:33:26 +00:00 committed by Justin Schuldt
parent 2080c27ef2
commit 7e461f489c
1 changed files with 5 additions and 3 deletions

View File

@ -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,
});
}
}