Skip to content

Commit

Permalink
using forloop for more readable code
Browse files Browse the repository at this point in the history
  • Loading branch information
patnir committed Sep 25, 2023
1 parent 5453fb9 commit 872547b
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions ironfish-cli/src/commands/wallet/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,18 @@ export class BalancesCommand extends IronfishCommand {

const assetBalancePairs: AssetBalancePairs[] = []

await Promise.all(
response.content.balances.map(async (element) => {
const asset = await client.wallet.getAsset({
account,
id: element.assetId,
confirmations: flags.confirmations,
})
for (const balance of response.content.balances) {
const asset = await client.wallet.getAsset({
account,
id: balance.assetId,
confirmations: flags.confirmations,
})

assetBalancePairs.push({
balance: element,
asset: asset.content,
})

const name = renderAssetNameFromHex(asset.content.name)

this.log(`Asset: ${name}`)
}),
)
assetBalancePairs.push({
balance,
asset: asset.content,
})
}

let columns: CliUx.Table.table.Columns<AssetBalancePairs> = {
assetName: {
Expand Down

0 comments on commit 872547b

Please sign in to comment.