Răsfoiți Sursa

bridge_ui: tvl chain name fix

Kevin Peters 3 ani în urmă
părinte
comite
7e461f489c
1 a modificat fișierele cu 5 adăugiri și 3 ștergeri
  1. 5 3
      bridge_ui/src/hooks/useTVL.ts

+ 5 - 3
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,
       });
     }
   }