Skip to content

Instantly share code, notes, and snippets.

@danieltorscho
Last active October 1, 2022 04:55
Show Gist options
  • Select an option

  • Save danieltorscho/082c3e872c290be1543fa271a9ccd106 to your computer and use it in GitHub Desktop.

Select an option

Save danieltorscho/082c3e872c290be1543fa271a9ccd106 to your computer and use it in GitHub Desktop.
myArray = await Promise.all(
currencies.map(async item => {
let usdt = item.total
if (item.currency !== 'USDT') {
const request = await axios.get(`https://api.binance.com/api/v3/ticker/price?symbol=${item.currency}USDT`)
usdt = request.data.price * item.total
}
return { ...item, usdt }
})
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment