Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ccxt-dev/ccxt
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jan 11, 2018
2 parents 627a519 + ecb3ce5 commit c53af2e
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 29 deletions.
17 changes: 10 additions & 7 deletions build/ccxt.browser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const errors = require ('./js/base/errors')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.10.635'
const version = '1.10.636'

Exchange.ccxtVersion = version

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.10.635",
"version": "1.10.636",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 90+ exchanges",
"main": "./ccxt.js",
"unpkg": "build/ccxt.browser.js",
Expand Down
2 changes: 1 addition & 1 deletion php/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace ccxt;

$version = '1.10.635';
$version = '1.10.636';

abstract class Exchange {

Expand Down
13 changes: 8 additions & 5 deletions php/binance.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,13 @@ public function parse_order ($order, $market = null) {
$symbol = $market['symbol'];
}
}
$timestamp = $order['time'];
$timestamp = null;
if (is_array ($order) && array_key_exists ('time', $order))
$timestamp = $order['time'];
else if (is_array ($order) && array_key_exists ('transactTime', $order))
$timestamp = $order['transactTime'];
else
throw new ExchangeError ($this->id . ' malformed $order => ' . $this->json ($order));
$price = floatval ($order['price']);
$amount = floatval ($order['origQty']);
$filled = $this->safe_float($order, 'executedQty', 0.0);
Expand Down Expand Up @@ -625,10 +631,7 @@ public function create_order ($symbol, $type, $side, $amount, $price = null, $pa
));
}
$response = $this->privatePostOrder (array_merge ($order, $params));
return array (
'info' => $response,
'id' => (string) $response['orderId'],
);
return $this->parse_order($response);
}

public function fetch_order ($id, $symbol = null, $params = array ()) {
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

# ----------------------------------------------------------------------------

__version__ = '1.10.635'
__version__ = '1.10.636'

# ----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.10.635'
__version__ = '1.10.636'

# -----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async/base/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.10.635'
__version__ = '1.10.636'

# -----------------------------------------------------------------------------

Expand Down
13 changes: 8 additions & 5 deletions python/ccxt/async/binance.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,13 @@ def parse_order(self, order, market=None):
if id in self.markets_by_id:
market = self.markets_by_id[id]
symbol = market['symbol']
timestamp = order['time']
timestamp = None
if 'time' in order:
timestamp = order['time']
elif 'transactTime' in order:
timestamp = order['transactTime']
else:
raise ExchangeError(self.id + ' malformed order: ' + self.json(order))
price = float(order['price'])
amount = float(order['origQty'])
filled = self.safe_float(order, 'executedQty', 0.0)
Expand Down Expand Up @@ -603,10 +609,7 @@ async def create_order(self, symbol, type, side, amount, price=None, params={}):
'timeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
})
response = await self.privatePostOrder(self.extend(order, params))
return {
'info': response,
'id': str(response['orderId']),
}
return self.parse_order(response)

async def fetch_order(self, id, symbol=None, params={}):
if not symbol:
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/base/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.10.635'
__version__ = '1.10.636'

# -----------------------------------------------------------------------------

Expand Down
13 changes: 8 additions & 5 deletions python/ccxt/binance.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,13 @@ def parse_order(self, order, market=None):
if id in self.markets_by_id:
market = self.markets_by_id[id]
symbol = market['symbol']
timestamp = order['time']
timestamp = None
if 'time' in order:
timestamp = order['time']
elif 'transactTime' in order:
timestamp = order['transactTime']
else:
raise ExchangeError(self.id + ' malformed order: ' + self.json(order))
price = float(order['price'])
amount = float(order['origQty'])
filled = self.safe_float(order, 'executedQty', 0.0)
Expand Down Expand Up @@ -603,10 +609,7 @@ def create_order(self, symbol, type, side, amount, price=None, params={}):
'timeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
})
response = self.privatePostOrder(self.extend(order, params))
return {
'info': response,
'id': str(response['orderId']),
}
return self.parse_order(response)

def fetch_order(self, id, symbol=None, params={}):
if not symbol:
Expand Down

0 comments on commit c53af2e

Please sign in to comment.