Last active
April 4, 2020 06:35
-
-
Save YasunoriMATSUOKA/d706f3ce80c750ebe189b96f214c155c 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 ccxt = require('ccxt'); | |
const defaultFetchTicker = async (exchange, ticker) => { | |
const exchangeObject = new ccxt[exchange]; | |
const tickerInfo = await exchangeObject.fetchTicker(ticker); | |
console.log(tickerInfo); | |
return tickerInfo; | |
} | |
const japanExchanges = [ | |
'bitbank', | |
'bitflyer', | |
'coincheck', | |
'liquid', | |
'zaif' | |
]; | |
(async () => { | |
const tickerInfos = await Promise.all(japanExchanges.map(async (exchange) => { | |
const tickerInfo = await defaultFetchTicker(exchange, 'BTC/JPY'); | |
const object = new Object(); | |
object[exchange] = tickerInfo; | |
return object; | |
})); | |
console.log(tickerInfos) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment