Skip to content

Commit

Permalink
1.14.8
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed May 16, 2018
1 parent f83099e commit cf48cc7
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 33 deletions.
43 changes: 34 additions & 9 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 Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.14.7'
const version = '1.14.8'

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.14.7",
"version": "1.14.8",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 100+ 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.14.7';
$version = '1.14.8';

// rounding mode
const TRUNCATE = 0;
Expand Down
20 changes: 15 additions & 5 deletions php/bittrex.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,14 @@ public function parse_order ($order, $market = null) {
$symbol = null;
if (is_array ($order) && array_key_exists ('Exchange', $order)) {
$marketId = $order['Exchange'];
if (is_array ($this->markets_by_id) && array_key_exists ($marketId, $this->markets_by_id))
$symbol = $this->markets_by_id[$marketId]['symbol'];
else
if (is_array ($this->markets_by_id) && array_key_exists ($marketId, $this->markets_by_id)) {
$market = $this->markets_by_id[$marketId];
$symbol = $market['symbol'];
} else {
$symbol = $this->parse_symbol ($marketId);
}
} else {
if ($market) {
if ($market !== null) {
$symbol = $market['symbol'];
}
}
Expand Down Expand Up @@ -549,8 +551,16 @@ public function parse_order ($order, $market = null) {
$fee = array (
'cost' => floatval ($order[$commission]),
);
if ($market)
if ($market !== null) {
$fee['currency'] = $market['quote'];
} else if ($symbol) {
$currencyIds = explode ('/', $symbol);
$quoteCurrencyId = $currencyIds[1];
if (is_array ($this->currencies_by_id) && array_key_exists ($quoteCurrencyId, $this->currencies_by_id))
$fee['currency'] = $this->currencies_by_id[$quoteCurrencyId]['code'];
else
$fee['currency'] = $this->common_currency_code($quoteCurrencyId);
}
}
$price = $this->safe_float($order, 'Limit');
$cost = $this->safe_float($order, 'Price');
Expand Down
19 changes: 17 additions & 2 deletions php/hitbtc.php
Original file line number Diff line number Diff line change
Expand Up @@ -778,19 +778,34 @@ public function parse_order ($order, $market = null) {
$cost = null;
$amountDefined = ($amount !== null);
$remainingDefined = ($remaining !== null);
if ($market) {
if ($market !== null) {
$symbol = $market['symbol'];
if ($amountDefined)
$amount *= $market['lot'];
if ($remainingDefined)
$remaining *= $market['lot'];
} else {
$marketId = $this->safe_string($order, 'symbol');
if (is_array ($this->markets_by_id) && array_key_exists ($marketId, $this->markets_by_id))
$market = $this->markets_by_id[$marketId];
}
if ($amountDefined) {
if ($remainingDefined) {
$filled = $amount - $remaining;
$cost = $averagePrice * $filled;
}
}
$feeCost = $this->safe_float($order, 'fee');
$feeCurrency = null;
if ($market !== null) {
$symbol = $market['symbol'];
$feeCurrency = $market['quote'];
}
$fee = array (
'cost' => $feeCost,
'currency' => $feeCurrency,
'rate' => null,
);
return array (
'id' => (string) $order['clientOrderId'],
'info' => $order,
Expand All @@ -806,7 +821,7 @@ public function parse_order ($order, $market = null) {
'amount' => $amount,
'filled' => $filled,
'remaining' => $remaining,
'fee' => null,
'fee' => $fee,
);
}

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

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

__version__ = '1.14.7'
__version__ = '1.14.8'

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

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.14.7'
__version__ = '1.14.8'

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

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.14.7'
__version__ = '1.14.8'

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

Expand Down
14 changes: 11 additions & 3 deletions python/ccxt/async/bittrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,12 @@ def parse_order(self, order, market=None):
if 'Exchange' in order:
marketId = order['Exchange']
if marketId in self.markets_by_id:
symbol = self.markets_by_id[marketId]['symbol']
market = self.markets_by_id[marketId]
symbol = market['symbol']
else:
symbol = self.parse_symbol(marketId)
else:
if market:
if market is not None:
symbol = market['symbol']
timestamp = None
if 'Opened' in order:
Expand All @@ -530,8 +531,15 @@ def parse_order(self, order, market=None):
fee = {
'cost': float(order[commission]),
}
if market:
if market is not None:
fee['currency'] = market['quote']
elif symbol:
currencyIds = symbol.split('/')
quoteCurrencyId = currencyIds[1]
if quoteCurrencyId in self.currencies_by_id:
fee['currency'] = self.currencies_by_id[quoteCurrencyId]['code']
else:
fee['currency'] = self.common_currency_code(quoteCurrencyId)
price = self.safe_float(order, 'Limit')
cost = self.safe_float(order, 'Price')
amount = self.safe_float(order, 'Quantity')
Expand Down
18 changes: 16 additions & 2 deletions python/ccxt/async/hitbtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,16 +763,30 @@ def parse_order(self, order, market=None):
cost = None
amountDefined = (amount is not None)
remainingDefined = (remaining is not None)
if market:
if market is not None:
symbol = market['symbol']
if amountDefined:
amount *= market['lot']
if remainingDefined:
remaining *= market['lot']
else:
marketId = self.safe_string(order, 'symbol')
if marketId in self.markets_by_id:
market = self.markets_by_id[marketId]
if amountDefined:
if remainingDefined:
filled = amount - remaining
cost = averagePrice * filled
feeCost = self.safe_float(order, 'fee')
feeCurrency = None
if market is not None:
symbol = market['symbol']
feeCurrency = market['quote']
fee = {
'cost': feeCost,
'currency': feeCurrency,
'rate': None,
}
return {
'id': str(order['clientOrderId']),
'info': order,
Expand All @@ -788,7 +802,7 @@ def parse_order(self, order, market=None):
'amount': amount,
'filled': filled,
'remaining': remaining,
'fee': None,
'fee': fee,
}

async def fetch_order(self, id, symbol=None, params={}):
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.14.7'
__version__ = '1.14.8'

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

Expand Down
14 changes: 11 additions & 3 deletions python/ccxt/bittrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,12 @@ def parse_order(self, order, market=None):
if 'Exchange' in order:
marketId = order['Exchange']
if marketId in self.markets_by_id:
symbol = self.markets_by_id[marketId]['symbol']
market = self.markets_by_id[marketId]
symbol = market['symbol']
else:
symbol = self.parse_symbol(marketId)
else:
if market:
if market is not None:
symbol = market['symbol']
timestamp = None
if 'Opened' in order:
Expand All @@ -530,8 +531,15 @@ def parse_order(self, order, market=None):
fee = {
'cost': float(order[commission]),
}
if market:
if market is not None:
fee['currency'] = market['quote']
elif symbol:
currencyIds = symbol.split('/')
quoteCurrencyId = currencyIds[1]
if quoteCurrencyId in self.currencies_by_id:
fee['currency'] = self.currencies_by_id[quoteCurrencyId]['code']
else:
fee['currency'] = self.common_currency_code(quoteCurrencyId)
price = self.safe_float(order, 'Limit')
cost = self.safe_float(order, 'Price')
amount = self.safe_float(order, 'Quantity')
Expand Down
18 changes: 16 additions & 2 deletions python/ccxt/hitbtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,16 +763,30 @@ def parse_order(self, order, market=None):
cost = None
amountDefined = (amount is not None)
remainingDefined = (remaining is not None)
if market:
if market is not None:
symbol = market['symbol']
if amountDefined:
amount *= market['lot']
if remainingDefined:
remaining *= market['lot']
else:
marketId = self.safe_string(order, 'symbol')
if marketId in self.markets_by_id:
market = self.markets_by_id[marketId]
if amountDefined:
if remainingDefined:
filled = amount - remaining
cost = averagePrice * filled
feeCost = self.safe_float(order, 'fee')
feeCurrency = None
if market is not None:
symbol = market['symbol']
feeCurrency = market['quote']
fee = {
'cost': feeCost,
'currency': feeCurrency,
'rate': None,
}
return {
'id': str(order['clientOrderId']),
'info': order,
Expand All @@ -788,7 +802,7 @@ def parse_order(self, order, market=None):
'amount': amount,
'filled': filled,
'remaining': remaining,
'fee': None,
'fee': fee,
}

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

0 comments on commit cf48cc7

Please sign in to comment.