Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function fetchBalances(keys) {
portfolio = {};
if (keys.cex) {
try {
cex = new ccxt.cex(keys.cex);
const cexWallet = await fetch(cex);
} catch (e) {
console.log('Failed to fetch Cex', e);
}
}
if (keys.bittrex) {
try {
bittrex = new ccxt.bittrex(keys.bittrex);
const bittrexWallet = await fetch(bittrex);
} catch (e) {
console.log('Failed to fetch Bittrex', e);
}
}
if (keys.binance) {
try {
binance = new ccxt.binance(keys.binance);
const binanceWallet = await fetch(binance);
} catch (e) {
console.log('Failed fetch Binance', e);
}
}
portfolio.total = calculateTotal();
constructor(auth: ExchangeAuthConfig, logger: Logger) {
const options = { apiKey: auth.key, secret: auth.secret };
const ccxtInstance = new bittrex(options);
super('Bittrex', options, ccxtInstance, logger);
}
}