Skip to content

Commit

Permalink
hitbtc use clientOrderId instead of orderId ccxt#125
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Aug 19, 2017
1 parent f2a2792 commit f2870ae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -10052,8 +10052,9 @@ var hitbtc = {
let difference = quantity - wholeLots;
if (Math.abs (difference) > p['step'])
throw new ExchangeError (this.id + ' order amount should be evenly divisible by lot unit size of ' + p['lot'].toString ());
let clientOrderId = this.nonce ()
let order = {
'clientOrderId': this.nonce (),
'clientOrderId': clientOrderId.toString (),
'symbol': p['id'],
'side': side,
'quantity': wholeLots.toString (), // quantity in integer lot units
Expand All @@ -10064,7 +10065,7 @@ var hitbtc = {
let response = await this.tradingPostNewOrder (this.extend (order, params));
return {
'info': response,
'id': response['ExecutionReport']['orderId'],
'id': response['ExecutionReport']['clientOrderId'],
};
},

Expand All @@ -10087,8 +10088,10 @@ var hitbtc = {
if (method == 'POST')
if (Object.keys (query).length)
body = this.urlencode (query);
if (Object.keys (query).length)
url += '?' + this.urlencode (query);
url += '?' + this.urlencode ({
'nonce': nonce,
'apikey': this.apiKey,
});
let auth = url + (body || '');
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
Expand Down

0 comments on commit f2870ae

Please sign in to comment.