sfccxt
Version:
A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges
28 lines (16 loc) • 648 B
JavaScript
// ----------------------------------------------------------------------------
const testBalance = require ('./test.balance.js')
// ----------------------------------------------------------------------------
module.exports = async (exchange) => {
const method = 'fetchBalance'
if (!(exchange.has[method])) {
console.log (exchange.id, method + '() is not supported')
return
}
console.log ('fetching balance...')
const response = await exchange[method] ()
testBalance (exchange, response)
console.log ('fetched balance items:', Object.keys(response).length)
return response
}