From 8e5a3f8343dce2a58a4b7dc9c40fab7c7b5b212a Mon Sep 17 00:00:00 2001 From: Sirapop Na Ranong Date: Wed, 24 Apr 2024 14:44:23 +0700 Subject: [PATCH] fix: get its asset config for get tvl --- methods/tvl/getTVL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/methods/tvl/getTVL.js b/methods/tvl/getTVL.js index ddc06f53..dd83421e 100644 --- a/methods/tvl/getTVL.js +++ b/methods/tvl/getTVL.js @@ -25,7 +25,7 @@ module.exports = async params => { const { asset, chain, force_update } = { ...params }; let { assets, chains } = { ...params }; assets = toArray(assets || asset); - assets = assets.length === 0 ? _.concat(assetsData, itsAssetsData).map(d => d.id) : await Promise.all(assets.map(d => new Promise(async resolve => resolve((await getAssetData(d, assetsData))?.denom || (await getITSAssetData(d, assetsData))?.id)))); + assets = assets.length === 0 ? _.concat(assetsData, itsAssetsData).map(d => d.id) : await Promise.all(assets.map(d => new Promise(async resolve => resolve((await getAssetData(d, assetsData))?.denom || (await getITSAssetData(d, itsAssetsData))?.id)))); chains = toArray(chains || chain); chains = chains.length === 0 ? getChainsList().filter(d => (d.chain_type === 'cosmos' || gateway_contracts?.[d.id]?.address) && !d.no_tvl).map(d => d.id) : _.uniq(_.concat('axelarnet', toArray(chains.map(d => getChainData(d)?.id))));