Created
April 28, 2021 09:10
-
-
Save infantiablue/3c8f54f125484f398633f0e74431c735 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchData = async () => { | |
let data = { index: [], price: [], volumes: [] }; | |
let result = await callAPI("https://api.coingecko.com/api/v3/coins/ethereum/market_chart?vs_currency=usd&days=1&interval=1m"); | |
for (const item of result.prices) { | |
data.index.push(item[0]); | |
data.price.push(item[1]); | |
} | |
for (const item of result.total_volumes) data.volumes.push(item[1]); | |
return data; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment