diff --git a/.gitignore b/.gitignore index 9e66041ea01e6..6ec38e2a7bd44 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ ccxt.wiki/ package-lock.json exchanges.json ccxt.sublime-workspace +.idea +yarn.lock \ No newline at end of file diff --git a/ccxt.js b/ccxt.js index 2704ef14ad630..bf47cb2b7f7a6 100644 --- a/ccxt.js +++ b/ccxt.js @@ -11827,12 +11827,18 @@ var okcoin = { let order = { 'symbol': this.marketId (market), 'type': side, - 'amount': amount, }; - if (type == 'limit') + if (type == 'limit') { order['price'] = price; - else + order['amount'] = amount; + } else { + if (order.type == 'buy') { + order['price'] = params; + } else { + order['amount'] = amount; + } order['type'] += '_market'; + } let response = await this.privatePostTrade (this.extend (order, params)); return { 'info': response,