Skip to content

Commit

Permalink
1.34.8
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Sep 9, 2020
1 parent ae3f65c commit 95ade25
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 40 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
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/[email protected].7/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].7/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].8/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].8/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/[email protected].7/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].8/dist/ccxt.browser.js"></script>
```

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

const version = '1.34.7'
const version = '1.34.8'

Exchange.ccxtVersion = version

Expand Down
24 changes: 18 additions & 6 deletions dist/ccxt.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.34.7'
const version = '1.34.8'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -87014,6 +87014,10 @@ module.exports = class okex extends Exchange {
'12h': '43200',
'1d': '86400',
'1w': '604800',
'1M': '2678400',
'3M': '8035200',
'6M': '16070400',
'1y': '31536000',
},
'hostname': 'okex.com',
'urls': {
Expand Down Expand Up @@ -87603,6 +87607,9 @@ module.exports = class okex extends Exchange {
},
'precisionMode': TICK_SIZE,
'options': {
'fetchOHLCV': {
'type': 'Candles', // Candles or HistoryCandles
},
'createMarketBuyOrderRequiresPrice': true,
'fetchMarkets': [ 'spot', 'futures', 'swap', 'option' ],
'defaultType': 'spot', // 'account', 'spot', 'margin', 'futures', 'swap', 'option'
Expand Down Expand Up @@ -88319,14 +88326,17 @@ module.exports = class okex extends Exchange {
async fetchOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
const market = this.market (symbol);
let method = undefined;
const duration = this.parseTimeframe (timeframe);
const request = {
'instrument_id': market['id'],
'granularity': this.timeframes[timeframe],
};
if (market['option'] || market['spot']) {
method = market['type'] + 'GetInstrumentsInstrumentIdCandles';
const options = this.safeValue (this.options, 'fetchOHLCV', {});
const defaultType = this.safeString (options, 'type', 'Candles'); // Candles or HistoryCandles
const type = this.safeString (params, 'type', defaultType);
params = this.omit (params, 'type');
const method = market['type'] + 'GetInstrumentsInstrumentId' + type;
if (type === 'Candles') {
if (since !== undefined) {
if (limit !== undefined) {
request['end'] = this.iso8601 (this.sum (since, limit * duration * 1000));
Expand All @@ -88339,8 +88349,10 @@ module.exports = class okex extends Exchange {
request['end'] = this.iso8601 (now);
}
}
} else {
method = market['type'] + 'GetInstrumentsInstrumentIdHistoryCandles';
} else if (type === 'HistoryCandles') {
if (market['option']) {
throw new NotSupported (this.id + ' fetchOHLCV does not have ' + type + ' for ' + market['type'] + ' markets');
}
if (since !== undefined) {
if (limit === undefined) {
limit = 300; // default
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.34.7",
"version": "1.34.8",
"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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use Elliptic\EdDSA;
use BN\BN;

$version = '1.34.7';
$version = '1.34.8';

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

class Exchange {

const VERSION = '1.34.7';
const VERSION = '1.34.8';

private static $base58_alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
private static $base58_encoder = null;
Expand Down
22 changes: 17 additions & 5 deletions php/okex.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public function describe() {
'12h' => '43200',
'1d' => '86400',
'1w' => '604800',
'1M' => '2678400',
'3M' => '8035200',
'6M' => '16070400',
'1y' => '31536000',
),
'hostname' => 'okex.com',
'urls' => array(
Expand Down Expand Up @@ -652,6 +656,9 @@ public function describe() {
),
'precisionMode' => TICK_SIZE,
'options' => array(
'fetchOHLCV' => array(
'type' => 'Candles', // Candles or HistoryCandles
),
'createMarketBuyOrderRequiresPrice' => true,
'fetchMarkets' => array( 'spot', 'futures', 'swap', 'option' ),
'defaultType' => 'spot', // 'account', 'spot', 'margin', 'futures', 'swap', 'option'
Expand Down Expand Up @@ -1368,14 +1375,17 @@ public function parse_ohlcv($ohlcv, $market = null) {
public function fetch_ohlcv($symbol, $timeframe = '1m', $since = null, $limit = null, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$method = null;
$duration = $this->parse_timeframe($timeframe);
$request = array(
'instrument_id' => $market['id'],
'granularity' => $this->timeframes[$timeframe],
);
if ($market['option'] || $market['spot']) {
$method = $market['type'] . 'GetInstrumentsInstrumentIdCandles';
$options = $this->safe_value($this->options, 'fetchOHLCV', array());
$defaultType = $this->safe_string($options, 'type', 'Candles'); // Candles or HistoryCandles
$type = $this->safe_string($params, 'type', $defaultType);
$params = $this->omit($params, 'type');
$method = $market['type'] . 'GetInstrumentsInstrumentId' . $type;
if ($type === 'Candles') {
if ($since !== null) {
if ($limit !== null) {
$request['end'] = $this->iso8601($this->sum($since, $limit * $duration * 1000));
Expand All @@ -1388,8 +1398,10 @@ public function fetch_ohlcv($symbol, $timeframe = '1m', $since = null, $limit =
$request['end'] = $this->iso8601($now);
}
}
} else {
$method = $market['type'] . 'GetInstrumentsInstrumentIdHistoryCandles';
} else if ($type === 'HistoryCandles') {
if ($market['option']) {
throw new NotSupported($this->id . ' fetchOHLCV does not have ' . $type . ' for ' . $market['type'] . ' markets');
}
if ($since !== null) {
if ($limit === null) {
$limit = 300; // default
Expand Down
6 changes: 3 additions & 3 deletions python/README.md
Original file line number Diff line number Diff line change
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/[email protected].7/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].7/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].8/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].8/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/[email protected].7/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].8/dist/ccxt.browser.js"></script>
```

Creates a global `ccxt` object:
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.34.7'
__version__ = '1.34.8'

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

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.34.7'
__version__ = '1.34.8'

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

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.34.7'
__version__ = '1.34.8'

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

Expand Down
21 changes: 16 additions & 5 deletions python/ccxt/async_support/okex.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def describe(self):
'12h': '43200',
'1d': '86400',
'1w': '604800',
'1M': '2678400',
'3M': '8035200',
'6M': '16070400',
'1y': '31536000',
},
'hostname': 'okex.com',
'urls': {
Expand Down Expand Up @@ -673,6 +677,9 @@ def describe(self):
},
'precisionMode': TICK_SIZE,
'options': {
'fetchOHLCV': {
'type': 'Candles', # Candles or HistoryCandles
},
'createMarketBuyOrderRequiresPrice': True,
'fetchMarkets': ['spot', 'futures', 'swap', 'option'],
'defaultType': 'spot', # 'account', 'spot', 'margin', 'futures', 'swap', 'option'
Expand Down Expand Up @@ -1351,14 +1358,17 @@ def parse_ohlcv(self, ohlcv, market=None):
async def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, params={}):
await self.load_markets()
market = self.market(symbol)
method = None
duration = self.parse_timeframe(timeframe)
request = {
'instrument_id': market['id'],
'granularity': self.timeframes[timeframe],
}
if market['option'] or market['spot']:
method = market['type'] + 'GetInstrumentsInstrumentIdCandles'
options = self.safe_value(self.options, 'fetchOHLCV', {})
defaultType = self.safe_string(options, 'type', 'Candles') # Candles or HistoryCandles
type = self.safe_string(params, 'type', defaultType)
params = self.omit(params, 'type')
method = market['type'] + 'GetInstrumentsInstrumentId' + type
if type == 'Candles':
if since is not None:
if limit is not None:
request['end'] = self.iso8601(self.sum(since, limit * duration * 1000))
Expand All @@ -1368,8 +1378,9 @@ async def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, para
now = self.milliseconds()
request['start'] = self.iso8601(now - limit * duration * 1000)
request['end'] = self.iso8601(now)
else:
method = market['type'] + 'GetInstrumentsInstrumentIdHistoryCandles'
elif type == 'HistoryCandles':
if market['option']:
raise NotSupported(self.id + ' fetchOHLCV does not have ' + type + ' for ' + market['type'] + ' markets')
if since is not None:
if limit is None:
limit = 300 # default
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.34.7'
__version__ = '1.34.8'

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

Expand Down
21 changes: 16 additions & 5 deletions python/ccxt/okex.py

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

2 changes: 1 addition & 1 deletion python/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.34.7",
"version": "1.34.8",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges",
"main": "./ccxt.js",
"unpkg": "dist/ccxt.browser.js",
Expand Down
6 changes: 3 additions & 3 deletions wiki/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ If that does not help, please, follow here: https://github.com/nodejs/node-gyp#o

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

* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].7/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].7/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].8/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].8/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.

```HTML
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].7/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].8/dist/ccxt.browser.js"></script>
```

Creates a global `ccxt` object:
Expand Down

0 comments on commit 95ade25

Please sign in to comment.