Skip to content

Commit

Permalink
1.14.190
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Jun 13, 2018
1 parent 454f43b commit 49051e7
Show file tree
Hide file tree
Showing 59 changed files with 238 additions and 234 deletions.
58 changes: 28 additions & 30 deletions build/ccxt.browser.js

Large diffs are not rendered by default.

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

const version = '1.14.189'
const version = '1.14.190'

Exchange.ccxtVersion = version

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.14.189",
"version": "1.14.190",
"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
Expand Up @@ -30,7 +30,7 @@

namespace ccxt;

$version = '1.14.189';
$version = '1.14.190';

// rounding mode
const TRUNCATE = 0;
Expand Down
2 changes: 1 addition & 1 deletion php/bibox.php
Expand Up @@ -394,7 +394,7 @@ public function fetch_balance ($params = array ()) {
}
$account = $this->account ();
$balance = $indexed[$id];
if (gettype ($balance) == 'string') {
if (gettype ($balance) === 'string') {
$balance = floatval ($balance);
$account['free'] = $balance;
$account['used'] = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion php/bitbank.php
Expand Up @@ -388,7 +388,7 @@ public function fetch_deposit_address ($code, $params = array ()) {
$response = $this->privateGetUserWithdrawalAccount (array_merge (array (
'asset' => $currency['id'],
), $params));
// Not sure about this if there could be more $accounts...
// Not sure about this if there could be more than one account...
$accounts = $response['data']['accounts'];
$address = $this->safe_string($accounts[0], 'address');
$status = $address ? 'ok' : 'none';
Expand Down
2 changes: 1 addition & 1 deletion php/bitbay.php
Expand Up @@ -304,7 +304,7 @@ public function sign ($path, $api = 'public', $method = 'GET', $params = array (
}

public function handle_errors ($httpCode, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default error handler
if (strlen ($body) < 2)
return;
Expand Down
2 changes: 1 addition & 1 deletion php/bithumb.php
Expand Up @@ -344,7 +344,7 @@ public function sign ($path, $api = 'public', $method = 'GET', $params = array (
}

public function handle_errors ($httpCode, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default error handler
if (strlen ($body) < 2)
return; // fallback to default error handler
Expand Down
6 changes: 3 additions & 3 deletions php/bitso.php
Expand Up @@ -407,7 +407,7 @@ public function fetch_deposit_address ($code, $params = array ()) {
$address = $this->safe_string($response['payload'], 'account_identifier');
$tag = null;
if ($code === 'XRP') {
$parts = $address.split ('?dt=', 2);
$parts = explode ('?dt=', $address);
$address = $parts[0];
$tag = $parts[1];
}
Expand Down Expand Up @@ -477,7 +477,7 @@ public function sign ($path, $api = 'public', $method = 'GET', $params = array (
}

public function handle_errors ($httpCode, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default $error handler
if (strlen ($body) < 2)
return; // fallback to default $error handler
Expand All @@ -488,7 +488,7 @@ public function handle_errors ($httpCode, $reason, $url, $method, $headers, $bod
// array ("$success":false,"$error":{"$code":104,"message":"Cannot perform request - nonce must be higher than 1520307203724237")}
//
$success = $this->safe_value($response, 'success', false);
if (gettype ($success) == 'string') {
if (gettype ($success) === 'string') {
if (($success === 'true') || ($success === '1'))
$success = true;
else
Expand Down
2 changes: 1 addition & 1 deletion php/bitstamp.php
Expand Up @@ -634,7 +634,7 @@ public function sign ($path, $api = 'public', $method = 'GET', $params = array (
}

public function handle_errors ($httpCode, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default error handler
if (strlen ($body) < 2)
return; // fallback to default error handler
Expand Down
12 changes: 6 additions & 6 deletions php/bittrex.php
Expand Up @@ -257,7 +257,7 @@ public function fetch_order_book ($symbol, $limit = null, $params = array ()) {
public function parse_ticker ($ticker, $market = null) {
$timestamp = $this->safe_string($ticker, 'TimeStamp');
$iso8601 = null;
if (gettype ($timestamp) == 'string') {
if (gettype ($timestamp) === 'string') {
if (strlen ($timestamp) > 0) {
$timestamp = $this->parse8601 ($timestamp);
$iso8601 = $this->iso8601 ($timestamp);
Expand Down Expand Up @@ -409,7 +409,7 @@ public function fetch_trades ($symbol, $since = null, $limit = null, $params = a
'market' => $market['id'],
), $params));
if (is_array ($response) && array_key_exists ('result', $response)) {
if ($response['result'] != null)
if ($response['result'] !== null)
return $this->parse_trades($response['result'], $market, $since, $limit);
}
throw new ExchangeError ($this->id . ' fetchTrades() returned null response');
Expand Down Expand Up @@ -513,7 +513,7 @@ public function parse_order ($order, $market = null) {
if ($isSellOrder) {
$side = 'sell';
}
// We parse different fields in a very specific $order.
// We parse different fields in a very specific $order->
// Order might well be closed and then canceled.
$status = null;
if ((is_array ($order) && array_key_exists ('Opened', $order)) && $order['Opened'])
Expand Down Expand Up @@ -544,9 +544,9 @@ public function parse_order ($order, $market = null) {
if (is_array ($order) && array_key_exists ('Created', $order))
$timestamp = $this->parse8601 ($order['Created'] . '+00:00');
$lastTradeTimestamp = null;
if ((is_array ($order) && array_key_exists ('TimeStamp', $order)) && ($order['TimeStamp'] != null))
if ((is_array ($order) && array_key_exists ('TimeStamp', $order)) && ($order['TimeStamp'] !== null))
$lastTradeTimestamp = $this->parse8601 ($order['TimeStamp'] . '+00:00');
if ((is_array ($order) && array_key_exists ('Closed', $order)) && ($order['Closed'] != null))
if ((is_array ($order) && array_key_exists ('Closed', $order)) && ($order['Closed'] !== null))
$lastTradeTimestamp = $this->parse8601 ($order['Closed'] . '+00:00');
if ($timestamp === null)
$timestamp = $lastTradeTimestamp;
Expand Down Expand Up @@ -735,7 +735,7 @@ public function handle_errors ($code, $reason, $url, $method, $headers, $body) {
$success = $this->safe_value($response, 'success');
if ($success === null)
throw new ExchangeError ($this->id . ' => malformed $response => ' . $this->json ($response));
if (gettype ($success) == 'string')
if (gettype ($success) === 'string')
// bleutrade uses string instead of boolean
$success = ($success === 'true') ? true : false;
if (!$success) {
Expand Down
8 changes: 4 additions & 4 deletions php/btctradeua.php
Expand Up @@ -164,13 +164,13 @@ public function fetch_ticker ($symbol, $params = array ()) {
$start = max ($tickerLength - 48, 0);
for ($t = $start; $t < count ($ticker); $t++) {
$candle = $ticker[$t];
if ($result['open'] == null)
if ($result['open'] === null)
$result['open'] = $candle[1];
if (($result['high'] == null) || ($result['high'] < $candle[2]))
if (($result['high'] === null) || ($result['high'] < $candle[2]))
$result['high'] = $candle[2];
if (($result['low'] == null) || ($result['low'] > $candle[3]))
if (($result['low'] === null) || ($result['low'] > $candle[3]))
$result['low'] = $candle[3];
if ($result['baseVolume'] == null)
if ($result['baseVolume'] === null)
$result['baseVolume'] = -$candle[5];
else
$result['baseVolume'] -= $candle[5];
Expand Down
4 changes: 2 additions & 2 deletions php/cex.php
Expand Up @@ -212,7 +212,7 @@ public function fetch_ohlcv ($symbol, $timeframe = '1m', $since = null, $limit =
$since = $this->milliseconds () - 86400000; // yesterday
} else {
if ($this->options['fetchOHLCVWarning']) {
throw new ExchangeError ($this->id . " fetchOHLCV warning => CEX can return historical candles for a certain date only, this might produce an empty or null $response. Set exchange.options['fetchOHLCVWarning'] = false or add (array ( 'options' => array ( 'fetchOHLCVWarning' => false ))) to constructor $params to suppress this warning message.");
throw new ExchangeError ($this->id . " fetchOHLCV warning => CEX can return historical candles for a certain date only, this might produce an empty or null reply. Set exchange.options['fetchOHLCVWarning'] = false or add (array ( 'options' => array ( 'fetchOHLCVWarning' => false ))) to constructor $params to suppress this warning message.");
}
}
$ymd = $this->ymd ($since);
Expand Down Expand Up @@ -359,7 +359,7 @@ public function parse_order ($order, $market = null) {
// Depending on the call, 'time' can be a unix int, unix string or ISO string
// Yes, really
$timestamp = $order['time'];
if (gettype ($order['time']) == 'string' && mb_strpos ($order['time'], 'T') !== false) {
if (gettype ($order['time']) === 'string' && mb_strpos ($order['time'], 'T') !== false) {
// ISO8601 string
$timestamp = $this->parse8601 ($timestamp);
} else {
Expand Down
2 changes: 1 addition & 1 deletion php/coinbase.php
Expand Up @@ -303,7 +303,7 @@ public function sign ($path, $api = 'public', $method = 'GET', $params = array (
}

public function handle_errors ($code, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default error handler
if (strlen ($body) < 2)
return; // fallback to default error handler
Expand Down
2 changes: 1 addition & 1 deletion php/coincheck.php
Expand Up @@ -176,7 +176,7 @@ public function fetch_trades ($symbol, $since = null, $limit = null, $params = a
), $params));
if (is_array ($response) && array_key_exists ('success', $response))
if ($response['success'])
if ($response['data'] != null)
if ($response['data'] !== null)
return $this->parse_trades($response['data'], $market, $since, $limit);
throw new ExchangeError ($this->id . ' ' . $this->json ($response));
}
Expand Down
2 changes: 1 addition & 1 deletion php/coinegg.php
Expand Up @@ -503,7 +503,7 @@ public function sign ($path, $api = 'public', $method = 'GET', $params = array (

public function handle_errors ($code, $reason, $url, $method, $headers, $body) {
// checks against error codes
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return;
if (strlen ($body) === 0)
return;
Expand Down
2 changes: 1 addition & 1 deletion php/coingi.php
Expand Up @@ -312,7 +312,7 @@ public function sign ($path, $api = 'current', $method = 'GET', $params = array

public function request ($path, $api = 'current', $method = 'GET', $params = array (), $headers = null, $body = null) {
$response = $this->fetch2 ($path, $api, $method, $params, $headers, $body);
if (gettype ($response) != 'string') {
if (gettype ($response) !== 'string') {
if (is_array ($response) && array_key_exists ('errors', $response))
throw new ExchangeError ($this->id . ' ' . $this->json ($response));
}
Expand Down
2 changes: 1 addition & 1 deletion php/cointiger.php
Expand Up @@ -563,7 +563,7 @@ public function sign ($path, $api = 'public', $method = 'GET', $params = array (
}

public function handle_errors ($httpCode, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default error handler
if (strlen ($body) < 2)
return; // fallback to default error handler
Expand Down
9 changes: 4 additions & 5 deletions php/cryptopia.php
Expand Up @@ -534,9 +534,8 @@ public function cancel_order ($id, $symbol = null, $params = array ()) {
'Type' => 'Trade',
'OrderId' => $id,
), $params));
// We do not know if it is indeed canceled, but cryptopia
// lacks any reasonable method to get information on executed
// or canceled order $id.
// We do not know if it is indeed canceled, but cryptopia lacks any
// reasonable method to get information on executed or canceled order.
if (is_array ($this->orders) && array_key_exists ($id, $this->orders))
$this->orders[$id]['status'] = 'canceled';
} catch (Exception $e) {
Expand Down Expand Up @@ -752,7 +751,7 @@ public function nonce () {
}

public function handle_errors ($code, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default $error handler
if (strlen ($body) < 2)
return; // fallback to default $error handler
Expand All @@ -764,7 +763,7 @@ public function handle_errors ($code, $reason, $url, $method, $headers, $body) {
if ($success === 'false') {
$error = $this->safe_string($response, 'Error');
$feedback = $this->id;
if (gettype ($error) == 'string') {
if (gettype ($error) === 'string') {
$feedback = $feedback . ' ' . $error;
if (mb_strpos ($error, 'does not exist') !== false) {
throw new OrderNotFound ($feedback);
Expand Down
8 changes: 4 additions & 4 deletions php/exmo.php
Expand Up @@ -403,8 +403,8 @@ public function update_cached_orders ($openOrders, $symbol) {
'filled' => $order['amount'],
'remaining' => 0.0,
));
if ($order['cost'] == null) {
if ($order['filled'] != null)
if ($order['cost'] === null) {
if ($order['filled'] !== null)
$order['cost'] = $order['filled'] * $order['price'];
}
$this->orders[$id] = $order;
Expand Down Expand Up @@ -635,7 +635,7 @@ public function nonce () {
}

public function handle_errors ($httpCode, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default error handler
if (strlen ($body) < 2)
return; // fallback to default error handler
Expand All @@ -646,7 +646,7 @@ public function handle_errors ($httpCode, $reason, $url, $method, $headers, $bod
// array ("result":false,"error":"Error 50052 => Insufficient funds")
//
$success = $this->safe_value($response, 'result', false);
if (gettype ($success) == 'string') {
if (gettype ($success) === 'string') {
if (($success === 'true') || ($success === '1'))
$success = true;
else
Expand Down
13 changes: 6 additions & 7 deletions php/gatecoin.php
Expand Up @@ -292,7 +292,7 @@ public function fetch_order ($id, $symbol = null, $params = array ()) {
$response = $this->privateGetTradeOrdersOrderID (array_merge (array (
'OrderID' => $id,
), $params));
return $this->parse_order($response.order);
return $this->parse_order($response->order);
}

public function parse_ticker ($ticker, $market = null) {
Expand Down Expand Up @@ -452,9 +452,8 @@ public function create_order ($symbol, $type, $side, $amount, $price = null, $pa
throw new AuthenticationError ($this->id . ' two-factor authentication requires a missing ValidationCode parameter');
}
$response = $this->privatePostTradeOrders (array_merge ($order, $params));
// At this point $response.responseStatus.message has been verified
// in handleErrors() to be == 'OK', so we assume the $order has
// indeed been opened.
// At this point $response['responseStatus']['message'] has been verified in handleErrors ()
// to be == 'OK', so we assume the $order has indeed been opened
return array (
'info' => $response,
'status' => 'open',
Expand Down Expand Up @@ -520,13 +519,13 @@ public function parse_order ($order, $market = null) {
$tradesFilled .= $trade['amount'];
$tradesCost .= $trade['amount'] * $trade['price'];
if (is_array ($trade) && array_key_exists ('fee', $trade)) {
if ($trade['fee']['cost'] != null) {
if ($trade['fee']['cost'] !== null) {
if ($feeCost === null)
$feeCost = 0.0;
$feeCost .= $trade['fee']['cost'];
}
$feeCurrency = $trade['fee']['currency'];
if ($trade['fee']['rate'] != null) {
if ($trade['fee']['rate'] !== null) {
if ($feeRate === null)
$feeRate = 0.0;
$feeRate .= $trade['fee']['rate'];
Expand Down Expand Up @@ -679,7 +678,7 @@ public function create_user_wallet ($code, $address, $name, $password, $params =
}

public function handle_errors ($code, $reason, $url, $method, $headers, $body) {
if (gettype ($body) != 'string')
if (gettype ($body) !== 'string')
return; // fallback to default error handler
if (strlen ($body) < 2)
return; // fallback to default error handler
Expand Down
4 changes: 2 additions & 2 deletions php/gateio.php
Expand Up @@ -462,7 +462,7 @@ public function query_deposit_address ($method, $code, $params = array ()) {
if (($address !== null) && (mb_strpos ($address, 'address') !== false))
throw new InvalidAddress ($this->id . ' queryDepositAddress ' . $address);
if ($code === 'XRP') {
$parts = $address.split ('/', 2);
$parts = $address->split ('/', 2);
$address = $parts[0];
$tag = $parts[1];
}
Expand Down Expand Up @@ -546,7 +546,7 @@ public function request ($path, $api = 'public', $method = 'GET', $params = arra
$message = $this->id . ' ' . $this->json ($response);
if ($result === null)
throw new ExchangeError ($message);
if (gettype ($result) == 'string') {
if (gettype ($result) === 'string') {
if ($result !== 'true')
throw new ExchangeError ($message);
} else if (!$result) {
Expand Down

0 comments on commit 49051e7

Please sign in to comment.