Skip to content

Commit

Permalink
1.20.57
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Dec 9, 2019
1 parent bb41f90 commit 0b793d4
Show file tree
Hide file tree
Showing 17 changed files with 334 additions and 42 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -226,13 +226,13 @@ console.log (ccxt.exchanges) // print all available exchanges

All-in-one browser bundle (dependencies included), served from a CDN of your choice:

* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.20.56/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.20.56/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.20.57/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.20.57/dist/ccxt.browser.js

CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.

```HTML
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.20.56/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.20.57/dist/ccxt.browser.js"></script>
```

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

const version = '1.20.56'
const version = '1.20.57'

Exchange.ccxtVersion = version

Expand Down
88 changes: 82 additions & 6 deletions dist/ccxt.browser.js
Expand Up @@ -43,7 +43,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.20.56'
const version = '1.20.57'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -31608,7 +31608,7 @@ module.exports = class bw extends Exchange {
// ---------------------------------------------------------------------------

const Exchange = require ('./base/Exchange');
const { ExchangeError, ArgumentsRequired, BadRequest, AuthenticationError, DDoSProtection } = require ('./base/errors');
const { ExchangeError, ArgumentsRequired, BadRequest, AuthenticationError, DDoSProtection, BadResponse } = require ('./base/errors');
const { TRUNCATE, NO_PADDING, DECIMAL_PLACES } = require ('./base/functions/number');

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -31911,7 +31911,43 @@ module.exports = class bytetrade extends Exchange {

parseTicker (ticker, market = undefined) {
const timestamp = this.safeInteger (ticker, 'timestamp');
const symbol = this.findSymbol (this.safeString (ticker, 'symbol'), market);
//
// [
// {
// "symbol":"68719476706",
// "name":"ETH/BTC",
// "base":"2",
// "quote":"32",
// "timestamp":1575905991933,
// "datetime":"2019-12-09T15:39:51.933Z",
// "high":"0",
// "low":"0",
// "open":"0",
// "close":"0",
// "last":"0",
// "change":"0",
// "percentage":"0",
// "baseVolume":"0",
// "quoteVolume":"0"
// }
// ]
//
let symbol = undefined;
const marketId = this.safeString (ticker, 'symbol');
if (marketId in this.markets_by_id) {
market = this.markets_by_id[marketId];
} else {
const baseId = this.safeString (ticker, 'base');
const quoteId = this.safeString (ticker, 'quote');
if ((baseId !== undefined) && (quoteId !== undefined)) {
const base = this.safeCurrencyCode (baseId);
const quote = this.safeCurrencyCode (quoteId);
symbol = base + '/' + quote;
}
}
if ((symbol === undefined) && (market !== undefined)) {
symbol = market['symbol'];
}
return {
'symbol': symbol,
'timestamp': timestamp,
Expand Down Expand Up @@ -31943,8 +31979,33 @@ module.exports = class bytetrade extends Exchange {
'symbol': market['id'],
};
const response = await this.marketGetTickers (this.extend (request, params));
if (response.length > 0) {
return this.parseTicker (response[0], market);
//
// [
// {
// "symbol":"68719476706",
// "name":"ETH/BTC",
// "base":"2",
// "quote":"32",
// "timestamp":1575905991933,
// "datetime":"2019-12-09T15:39:51.933Z",
// "high":"0",
// "low":"0",
// "open":"0",
// "close":"0",
// "last":"0",
// "change":"0",
// "percentage":"0",
// "baseVolume":"0",
// "quoteVolume":"0"
// }
// ]
//
if (Array.isArray (response)) {
const ticker = this.safeValue (response, 0);
if (ticker === undefined) {
throw BadResponse (this.id + ' fetchTicker() returned an empty response');
}
return this.parseTicker (ticker, market);
}
return this.parseTicker (response, market);
}
Expand Down Expand Up @@ -32052,7 +32113,22 @@ module.exports = class bytetrade extends Exchange {

parseOrder (order, market = undefined) {
const status = this.safeString (order, 'status');
const symbol = this.findSymbol (this.safeString (order, 'symbol'), market);
let symbol = undefined;
const marketId = this.safeString (order, 'symbol');
if (marketId in this.markets_by_id) {
market = this.markets_by_id[marketId];
} else {
const baseId = this.safeString (order, 'base');
const quoteId = this.safeString (order, 'quote');
if ((baseId !== undefined) && (quoteId !== undefined)) {
const base = this.safeCurrencyCode (baseId);
const quote = this.safeCurrencyCode (quoteId);
symbol = base + '/' + quote;
}
}
if ((symbol === undefined) && (market !== undefined)) {
symbol = market['symbol'];
}
const timestamp = this.safeInteger (order, 'timestamp');
const datetime = this.safeString (order, 'datetime');
const lastTradeTimestamp = this.safeInteger (order, 'lastTradeTimestamp');
Expand Down
6 changes: 3 additions & 3 deletions doc/README.rst
Expand Up @@ -369,14 +369,14 @@ JavaScript (for use with the ``<script>`` tag):

All-in-one browser bundle (dependencies included), served from a CDN of your choice:

- jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.20.56/dist/ccxt.browser.js
- unpkg: https://unpkg.com/ccxt@1.20.56/dist/ccxt.browser.js
- jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.20.57/dist/ccxt.browser.js
- unpkg: https://unpkg.com/ccxt@1.20.57/dist/ccxt.browser.js

CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.

.. code:: html

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.20.56/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.20.57/dist/ccxt.browser.js"></script>

Creates a global ``ccxt`` object:

Expand Down
6 changes: 3 additions & 3 deletions doc/install.rst
Expand Up @@ -62,14 +62,14 @@ JavaScript (for use with the ``<script>`` tag):

All-in-one browser bundle (dependencies included), served from a CDN of your choice:

- jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.20.56/dist/ccxt.browser.js
- unpkg: https://unpkg.com/ccxt@1.20.56/dist/ccxt.browser.js
- jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.20.57/dist/ccxt.browser.js
- unpkg: https://unpkg.com/ccxt@1.20.57/dist/ccxt.browser.js

You can obtain a live-updated version of the bundle by removing the version number from the URL (the ``@a.b.c`` thing) — however, we do not recommend to do that, as it may break your app eventually. Also, please keep in mind that we are not responsible for the correct operation of those CDN servers.

.. code:: html

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.20.56/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.20.57/dist/ccxt.browser.js"></script>

Creates a global ``ccxt`` object:

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.20.56",
"version": "1.20.57",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges",
"main": "./ccxt.js",
"unpkg": "dist/ccxt.browser.js",
Expand Down
4 changes: 2 additions & 2 deletions php/base/Exchange.php
Expand Up @@ -35,7 +35,7 @@
use Elliptic\EC;
use BN\BN;

$version = '1.20.56';
$version = '1.20.57';

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

class Exchange {

const VERSION = '1.20.56';
const VERSION = '1.20.57';

public static $eth_units = array (
'wei' => '1',
Expand Down
84 changes: 80 additions & 4 deletions php/bytetrade.php
Expand Up @@ -306,7 +306,43 @@ public function fetch_order_book ($symbol, $limit = null, $params = array ()) {

public function parse_ticker ($ticker, $market = null) {
$timestamp = $this->safe_integer($ticker, 'timestamp');
$symbol = $this->find_symbol($this->safe_string($ticker, 'symbol'), $market);
//
// array (
// {
// "$symbol":"68719476706",
// "name":"ETH/BTC",
// "$base":"2",
// "$quote":"32",
// "$timestamp":1575905991933,
// "datetime":"2019-12-09T15:39:51.933Z",
// "high":"0",
// "low":"0",
// "open":"0",
// "close":"0",
// "last":"0",
// "change":"0",
// "percentage":"0",
// "baseVolume":"0",
// "quoteVolume":"0"
// }
// )
//
$symbol = null;
$marketId = $this->safe_string($ticker, 'symbol');
if (is_array($this->markets_by_id) && array_key_exists($marketId, $this->markets_by_id)) {
$market = $this->markets_by_id[$marketId];
} else {
$baseId = $this->safe_string($ticker, 'base');
$quoteId = $this->safe_string($ticker, 'quote');
if (($baseId !== null) && ($quoteId !== null)) {
$base = $this->safe_currency_code($baseId);
$quote = $this->safe_currency_code($quoteId);
$symbol = $base . '/' . $quote;
}
}
if (($symbol === null) && ($market !== null)) {
$symbol = $market['symbol'];
}
return array (
'symbol' => $symbol,
'timestamp' => $timestamp,
Expand Down Expand Up @@ -338,8 +374,33 @@ public function fetch_ticker ($symbol, $params = array ()) {
'symbol' => $market['id'],
);
$response = $this->marketGetTickers (array_merge ($request, $params));
if (strlen ($response) > 0) {
return $this->parse_ticker($response[0], $market);
//
// array (
// {
// "$symbol":"68719476706",
// "name":"ETH/BTC",
// "base":"2",
// "quote":"32",
// "timestamp":1575905991933,
// "datetime":"2019-12-09T15:39:51.933Z",
// "high":"0",
// "low":"0",
// "open":"0",
// "close":"0",
// "last":"0",
// "change":"0",
// "percentage":"0",
// "baseVolume":"0",
// "quoteVolume":"0"
// }
// )
//
if (gettype ($response) === 'array' && count (array_filter (array_keys ($response), 'is_string')) == 0) {
$ticker = $this->safe_value($response, 0);
if ($ticker === null) {
throw BadResponse ($this->id . ' fetchTicker() returned an empty response');
}
return $this->parse_ticker($ticker, $market);
}
return $this->parse_ticker($response, $market);
}
Expand Down Expand Up @@ -447,7 +508,22 @@ public function fetch_trades ($symbol, $since = null, $limit = null, $params = a

public function parse_order ($order, $market = null) {
$status = $this->safe_string($order, 'status');
$symbol = $this->find_symbol($this->safe_string($order, 'symbol'), $market);
$symbol = null;
$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];
} else {
$baseId = $this->safe_string($order, 'base');
$quoteId = $this->safe_string($order, 'quote');
if (($baseId !== null) && ($quoteId !== null)) {
$base = $this->safe_currency_code($baseId);
$quote = $this->safe_currency_code($quoteId);
$symbol = $base . '/' . $quote;
}
}
if (($symbol === null) && ($market !== null)) {
$symbol = $market['symbol'];
}
$timestamp = $this->safe_integer($order, 'timestamp');
$datetime = $this->safe_string($order, 'datetime');
$lastTradeTimestamp = $this->safe_integer($order, 'lastTradeTimestamp');
Expand Down
6 changes: 3 additions & 3 deletions python/README.rst
Expand Up @@ -369,14 +369,14 @@ JavaScript (for use with the ``<script>`` tag):

All-in-one browser bundle (dependencies included), served from a CDN of your choice:

- jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.20.56/dist/ccxt.browser.js
- unpkg: https://unpkg.com/ccxt@1.20.56/dist/ccxt.browser.js
- jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.20.57/dist/ccxt.browser.js
- unpkg: https://unpkg.com/ccxt@1.20.57/dist/ccxt.browser.js

CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.

.. code:: html

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.20.56/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.20.57/dist/ccxt.browser.js"></script>

Creates a global ``ccxt`` object:

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Expand Up @@ -22,7 +22,7 @@

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

__version__ = '1.20.56'
__version__ = '1.20.57'

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

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/__init__.py
Expand Up @@ -4,7 +4,7 @@

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

__version__ = '1.20.56'
__version__ = '1.20.57'

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

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/base/exchange.py
Expand Up @@ -2,7 +2,7 @@

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

__version__ = '1.20.56'
__version__ = '1.20.57'

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

Expand Down

0 comments on commit 0b793d4

Please sign in to comment.