From 0bd4d153cc850ab63db96a71462b9bc2658dd1e5 Mon Sep 17 00:00:00 2001 From: Danil Shaymurzin Date: Mon, 30 Dec 2024 20:15:52 +0500 Subject: [PATCH] fix: tokenSymbol return for rewardTokens --- src/adaptors/evaa-protocol/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/adaptors/evaa-protocol/index.js b/src/adaptors/evaa-protocol/index.js index 500139e3a8..19db20432f 100644 --- a/src/adaptors/evaa-protocol/index.js +++ b/src/adaptors/evaa-protocol/index.js @@ -33,6 +33,12 @@ const assets = { tsTON: { assetId: sha256Hash("tsTON"), token: 'EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav' }, }; +function findAssetKeyByBigIntId(searchAssetId) { + return Object.entries(assets).find(([key, value]) => + BigInt(value.assetId) === searchAssetId + )?.[0]; +} + const MASTER_CONSTANTS = { FACTOR_SCALE: BigInt(1e12), @@ -380,7 +386,9 @@ const getApy = async () => { ); const apyReward = apyRewardData ? apyRewardData.apy : undefined; - const rewardTokens = apyRewardData ? [apyRewardData.rewardsAssetId] : undefined; + const rewardTokens = apyRewardData + ? [findAssetKeyByBigIntId(apyRewardData.rewardsAssetId)] + : undefined; const apyRewardBorrowData = rewardApys.find( (rewardApy) =>