From 918332641c765530bb96072cb7a4076612208fbe Mon Sep 17 00:00:00 2001 From: hichri-louay Date: Wed, 25 Oct 2023 16:27:10 +0100 Subject: [PATCH] correction for trx tokens --- web3/wallets.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/web3/wallets.js b/web3/wallets.js index 6283049d..408cc109 100644 --- a/web3/wallets.js +++ b/web3/wallets.js @@ -1221,22 +1221,17 @@ exports.getListCryptoByUid = async (req, res) => { for (let T_network in web3s) { if (web3s[T_network]) { if (T_network == 'TRON') { - balancesBynetwork[T_network] = [ - await this.getTronBalance( + const balanceTronList = []; + for(let token of tokensInfosByNetwork[T_network]) { + const tronBalance = await this.getTronBalance( await webTronInstance(), - false, + token.contract, tronAddress, - true - ), - ] - /* balancesBynetwork[T_network] = balancesBynetwork[T_network].concat(balancesBynetwork[T_network],await this.multicall( - tokensByNetwork[T_network], - addressesByNetwork[T_network], - T_network, - web3s[T_network] - - )) - console.log(balancesBynetwork[T_network])*/ + token.key === 'TRX' ? true : false + ) + balanceTronList.push(tronBalance) + } + balancesBynetwork[T_network] = balanceTronList } else { balancesBynetwork[T_network] = await this.multicall( tokensByNetwork[T_network],