Skip to content

Instantly share code, notes, and snippets.

@YasunoriMATSUOKA
Last active April 4, 2020 06:35
Show Gist options
  • Save YasunoriMATSUOKA/d706f3ce80c750ebe189b96f214c155c to your computer and use it in GitHub Desktop.
Save YasunoriMATSUOKA/d706f3ce80c750ebe189b96f214c155c to your computer and use it in GitHub Desktop.
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