Skip to content

Commit

Permalink
correction for trx tokens (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
hichri-louay authored Oct 25, 2023
2 parents 5620716 + 9183326 commit 250cb9a
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions web3/wallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 250cb9a

Please sign in to comment.