Skip to content

Commit

Permalink
kraken non-market-orders fix #3040
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jun 5, 2018
1 parent f641d25 commit d705494
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/kraken.js
Expand Up @@ -628,8 +628,13 @@ module.exports = class kraken extends Exchange {
'ordertype': type,
'volume': this.amountToPrecision (symbol, amount),
};
if (type === 'limit')
let priceIsDefined = (typeof price !== 'undefined');
let marketOrder = (type === 'market');
let limitOrder = (type === 'limit');
let shouldIncludePrice = limitOrder || (!marketOrder && priceIsDefined);
if (shouldIncludePrice) {
order['price'] = this.priceToPrecision (symbol, price);
}
let response = await this.privatePostAddOrder (this.extend (order, params));
let id = this.safeValue (response['result'], 'txid');
if (typeof id !== 'undefined') {
Expand Down

0 comments on commit d705494

Please sign in to comment.