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 Jul 18, 2018
2 parents dc53537 + 7e8fb00 commit baaf465
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 25 deletions.
16 changes: 11 additions & 5 deletions build/ccxt.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.16.60'
const version = '1.16.61'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -25185,17 +25185,23 @@ module.exports = class cointiger extends huobipro {
amount = this.safeFloat (order['volume'], 'amount');
remaining = ('remain_volume' in order) ? this.safeFloat (order['remain_volume'], 'amount') : undefined;
filled = ('deal_volume' in order) ? this.safeFloat (order['deal_volume'], 'amount') : undefined;
price = ('age_price' in order) ? this.safeFloat (order['age_price'], 'amount') : undefined;
if (typeof price === 'undefined')
price = ('price' in order) ? this.safeFloat (order['price'], 'amount') : undefined;
price = ('price' in order) ? this.safeFloat (order['price'], 'amount') : undefined;
if ('age_price' in order) {
let average = this.safeFloat (order['age_price'], 'amount');
if ((typeof average !== 'undefined') && (average > 0)) {
price = average;
}
}
} else {
if (typeof orderType !== 'undefined') {
let parts = orderType.split ('-');
side = parts[0];
type = parts[1];
cost = this.safeFloat (order, 'deal_money');
price = this.safeFloat (order, 'price');
price = this.safeFloat (order, 'avg_price', price);
let average = this.safeFloat (order, 'avg_price');
if ((typeof average !== 'undefined') && (average > 0))
price = average;
amount = this.safeFloat2 (order, 'amount', 'volume');
filled = this.safeFloat (order, 'deal_volume');
let feeCost = this.safeFloat (order, 'fee');
Expand Down
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.16.60'
const version = '1.16.61'

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.16.60",
"version": "1.16.61",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 100+ exchanges",
"main": "./ccxt.js",
"unpkg": "build/ccxt.browser.js",
Expand Down
4 changes: 2 additions & 2 deletions php/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace ccxt;

$version = '1.16.60';
$version = '1.16.61';

// rounding mode
const TRUNCATE = 0;
Expand All @@ -46,7 +46,7 @@

class Exchange {

const VERSION = '1.16.60';
const VERSION = '1.16.61';

public static $exchanges = array (
'_1broker',
Expand Down
14 changes: 10 additions & 4 deletions php/cointiger.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,17 +621,23 @@ public function parse_order ($order, $market = null) {
$amount = $this->safe_float($order['volume'], 'amount');
$remaining = (is_array ($order) && array_key_exists ('remain_volume', $order)) ? $this->safe_float($order['remain_volume'], 'amount') : null;
$filled = (is_array ($order) && array_key_exists ('deal_volume', $order)) ? $this->safe_float($order['deal_volume'], 'amount') : null;
$price = (is_array ($order) && array_key_exists ('age_price', $order)) ? $this->safe_float($order['age_price'], 'amount') : null;
if ($price === null)
$price = (is_array ($order) && array_key_exists ('price', $order)) ? $this->safe_float($order['price'], 'amount') : null;
$price = (is_array ($order) && array_key_exists ('price', $order)) ? $this->safe_float($order['price'], 'amount') : null;
if (is_array ($order) && array_key_exists ('age_price', $order)) {
$average = $this->safe_float($order['age_price'], 'amount');
if (($average !== null) && ($average > 0)) {
$price = $average;
}
}
} else {
if ($orderType !== null) {
$parts = explode ('-', $orderType);
$side = $parts[0];
$type = $parts[1];
$cost = $this->safe_float($order, 'deal_money');
$price = $this->safe_float($order, 'price');
$price = $this->safe_float($order, 'avg_price', $price);
$average = $this->safe_float($order, 'avg_price');
if (($average !== null) && ($average > 0))
$price = $average;
$amount = $this->safe_float_2($order, 'amount', 'volume');
$filled = $this->safe_float($order, 'deal_volume');
$feeCost = $this->safe_float($order, '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.16.60'
__version__ = '1.16.61'

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

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

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

__version__ = '1.16.60'
__version__ = '1.16.61'

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

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

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

__version__ = '1.16.60'
__version__ = '1.16.61'

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

Expand Down
12 changes: 8 additions & 4 deletions python/ccxt/async_support/cointiger.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,17 +601,21 @@ def parse_order(self, order, market=None):
amount = self.safe_float(order['volume'], 'amount')
remaining = self.safe_float(order['remain_volume'], 'amount') if ('remain_volume' in list(order.keys())) else None
filled = self.safe_float(order['deal_volume'], 'amount') if ('deal_volume' in list(order.keys())) else None
price = self.safe_float(order['age_price'], 'amount') if ('age_price' in list(order.keys())) else None
if price is None:
price = self.safe_float(order['price'], 'amount') if ('price' in list(order.keys())) else None
price = self.safe_float(order['price'], 'amount') if ('price' in list(order.keys())) else None
if 'age_price' in order:
average = self.safe_float(order['age_price'], 'amount')
if (average is not None) and(average > 0):
price = average
else:
if orderType is not None:
parts = orderType.split('-')
side = parts[0]
type = parts[1]
cost = self.safe_float(order, 'deal_money')
price = self.safe_float(order, 'price')
price = self.safe_float(order, 'avg_price', price)
average = self.safe_float(order, 'avg_price')
if (average is not None) and(average > 0):
price = average
amount = self.safe_float_2(order, 'amount', 'volume')
filled = self.safe_float(order, 'deal_volume')
feeCost = self.safe_float(order, 'fee')
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.16.60'
__version__ = '1.16.61'

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

Expand Down
12 changes: 8 additions & 4 deletions python/ccxt/cointiger.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,17 +601,21 @@ def parse_order(self, order, market=None):
amount = self.safe_float(order['volume'], 'amount')
remaining = self.safe_float(order['remain_volume'], 'amount') if ('remain_volume' in list(order.keys())) else None
filled = self.safe_float(order['deal_volume'], 'amount') if ('deal_volume' in list(order.keys())) else None
price = self.safe_float(order['age_price'], 'amount') if ('age_price' in list(order.keys())) else None
if price is None:
price = self.safe_float(order['price'], 'amount') if ('price' in list(order.keys())) else None
price = self.safe_float(order['price'], 'amount') if ('price' in list(order.keys())) else None
if 'age_price' in order:
average = self.safe_float(order['age_price'], 'amount')
if (average is not None) and(average > 0):
price = average
else:
if orderType is not None:
parts = orderType.split('-')
side = parts[0]
type = parts[1]
cost = self.safe_float(order, 'deal_money')
price = self.safe_float(order, 'price')
price = self.safe_float(order, 'avg_price', price)
average = self.safe_float(order, 'avg_price')
if (average is not None) and(average > 0):
price = average
amount = self.safe_float_2(order, 'amount', 'volume')
filled = self.safe_float(order, 'deal_volume')
feeCost = self.safe_float(order, 'fee')
Expand Down

0 comments on commit baaf465

Please sign in to comment.