sfccxt
Version:
A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges
36 lines (23 loc) • 778 B
JavaScript
// ----------------------------------------------------------------------------
const assert = require ('assert')
, ccxt = require ('../../../ccxt.js')
// ----------------------------------------------------------------------------
module.exports = async (exchange, symbol) => {
if (!exchange.has.createOrder) {
console.log ('createOrder() is not supported')
return
}
try {
await exchange.createLimitBuyOrder (symbol, 0, 0)
assert (false)
} catch (e) {
if (e instanceof ccxt.InvalidOrder) {
console.log ('InvalidOrder thrown as expected')
return
} else {
console.log ('InvalidOrder failed, exception follows:')
throw e
}
}
}