refactor: exchanges config validation and error handling
This commit is contained in:
parent
60a19af1a8
commit
dabe21f834
6 changed files with 34 additions and 20 deletions
|
|
@ -25,6 +25,7 @@ function trade (side, account, cryptoAtoms, fiatCode, cryptoCode, exchangeName)
|
|||
if (ORDER_TYPE === ORDER_TYPES.MARKET) {
|
||||
return exchange.createOrder(symbol, ORDER_TYPES.MARKET, side, amount, null, options)
|
||||
}
|
||||
|
||||
return exchange.fetchOrderBook(symbol)
|
||||
.then(orderBook => {
|
||||
const price = calculatePrice(side, amount, orderBook).toFixed(DEFAULT_PRICE_PRECISION)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue