sfccxt
Version:
A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges
26 lines (15 loc) • 627 B
JavaScript
// ----------------------------------------------------------------------------
const testAccount = require ('./test.account.js')
// ----------------------------------------------------------------------------
module.exports = async (exchange) => {
const method = 'fetchAccounts'
if (!(exchange.has[method])) {
console.log (exchange.id, method + '() is not supported')
return
}
console.log ('fetching accounts...')
const accounts = await exchange[method] ()
Object.values (accounts).forEach ((account) => testAccount (exchange, account))
return accounts
}