Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
1.19.35
[ci skip]
  • Loading branch information
Travis CI committed Nov 12, 2019
1 parent 9c8b266 commit a08bbb6
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 36 deletions.
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.19.34'
const version = '1.19.35'

Exchange.ccxtVersion = version

Expand Down
25 changes: 18 additions & 7 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.19.34'
const version = '1.19.35'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -72657,6 +72657,11 @@ module.exports = class okcoinusd extends Exchange {
'1w': '1week',
},
'api': {
'v3': {
'get': [
'futures/pc/market/futuresCoin',
],
},
'web': {
'get': [
'futures/pc/market/marketOverview',
Expand Down Expand Up @@ -72736,6 +72741,7 @@ module.exports = class okcoinusd extends Exchange {
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/27766791-89ffb502-5ee5-11e7-8a5b-c5950b68ac65.jpg',
'api': {
'v3': 'https://www.okcoin.com/v3',
'web': 'https://www.okcoin.com/v2',
'public': 'https://www.okcoin.com/api',
'private': 'https://www.okcoin.com',
Expand Down Expand Up @@ -72981,7 +72987,9 @@ module.exports = class okcoinusd extends Exchange {
const spotMarkets = this.safeValue (spotResponse, 'data', []);
let markets = spotMarkets;
if (this.has['futures']) {
const futuresResponse = await this.webPostFuturesPcMarketFuturesCoin ();
const futuresResponse = await this.v3GetFuturesPcMarketFuturesCoin ({
'currencyCode': 0,
});
//
// {
// "msg":"success",
Expand Down Expand Up @@ -73015,7 +73023,8 @@ module.exports = class okcoinusd extends Exchange {
// ]
// }
//
const futuresMarkets = this.safeValue (futuresResponse, 'data', []);
const data = this.safeValue (futuresResponse, 'data', {});
const futuresMarkets = this.safeValue (data, 'usd', []);
markets = this.arrayConcat (spotMarkets, futuresMarkets);
}
for (let i = 0; i < markets.length; i++) {
Expand Down Expand Up @@ -73050,8 +73059,8 @@ module.exports = class okcoinusd extends Exchange {
contracts = [{}];
} else {
// futures markets
quoteId = this.safeString (market, 'quote');
uppercaseBaseId = this.safeString (market, 'symbolDesc');
quoteId = this.safeStringLower2 (market, 'quote', 'denomination');
uppercaseBaseId = this.safeStringLower (market, 'symbolDesc');
baseId = uppercaseBaseId.toLowerCase ();
lowercaseId = baseId + '_' + quoteId;
base = this.safeCurrencyCode (uppercaseBaseId);
Expand Down Expand Up @@ -73663,11 +73672,12 @@ module.exports = class okcoinusd extends Exchange {

sign (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
let url = '/';
if (api !== 'web') {
const isWebApi = (api === 'web') || (api === 'v3');
if (!isWebApi) {
url += this.version + '/';
}
url += path;
if (api !== 'web') {
if (!isWebApi) {
url += this.extension;
}
if (api === 'private') {
Expand Down Expand Up @@ -73746,6 +73756,7 @@ module.exports = class okex extends okcoinusd {
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg',
'api': {
'v3': 'https://www.okex.com/v3',
'web': 'https://www.okex.com/v2',
'public': 'https://www.okex.com/api',
'private': 'https://www.okex.com/api',
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.19.34",
"version": "1.19.35",
"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.19.34';
$version = '1.19.35';

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

class Exchange {

const VERSION = '1.19.34';
const VERSION = '1.19.35';

public static $eth_units = array (
'wei' => '1',
Expand Down
26 changes: 18 additions & 8 deletions php/okcoinusd.php
Expand Up @@ -44,6 +44,11 @@ public function describe () {
'1w' => '1week',
),
'api' => array (
'v3' => array (
'get' => array (
'futures/pc/market/futuresCoin',
),
),
'web' => array (
'get' => array (
'futures/pc/market/marketOverview',
Expand Down Expand Up @@ -123,6 +128,7 @@ public function describe () {
'urls' => array (
'logo' => 'https://user-images.githubusercontent.com/1294454/27766791-89ffb502-5ee5-11e7-8a5b-c5950b68ac65.jpg',
'api' => array (
'v3' => 'https://www.okcoin.com/v3',
'web' => 'https://www.okcoin.com/v2',
'public' => 'https://www.okcoin.com/api',
'private' => 'https://www.okcoin.com',
Expand Down Expand Up @@ -334,7 +340,7 @@ public function fetch_markets ($params = array ()) {
//
// {
// "code" => 0,
// "data" => array (
// "$data" => array (
// array (
// "baseCurrency":0,
// "brokerId":0,
Expand Down Expand Up @@ -368,13 +374,15 @@ public function fetch_markets ($params = array ()) {
$spotMarkets = $this->safe_value($spotResponse, 'data', array());
$markets = $spotMarkets;
if ($this->has['futures']) {
$futuresResponse = $this->webPostFuturesPcMarketFuturesCoin ();
$futuresResponse = $this->v3GetFuturesPcMarketFuturesCoin (array (
'currencyCode' => 0,
));
//
// {
// "msg":"success",
// "code":0,
// "detailMsg":"",
// "data" => [
// "$data" => [
// array (
// "symbolId":0,
// "$symbol":"f_usd_btc",
Expand Down Expand Up @@ -402,7 +410,8 @@ public function fetch_markets ($params = array ()) {
// ]
// }
//
$futuresMarkets = $this->safe_value($futuresResponse, 'data', array());
$data = $this->safe_value($futuresResponse, 'data', array());
$futuresMarkets = $this->safe_value($data, 'usd', array());
$markets = $this->array_concat($spotMarkets, $futuresMarkets);
}
for ($i = 0; $i < count ($markets); $i++) {
Expand Down Expand Up @@ -437,8 +446,8 @@ public function fetch_markets ($params = array ()) {
$contracts = [array()];
} else {
// futures $markets
$quoteId = $this->safe_string($market, 'quote');
$uppercaseBaseId = $this->safe_string($market, 'symbolDesc');
$quoteId = $this->safe_string_lower_2($market, 'quote', 'denomination');
$uppercaseBaseId = $this->safe_string_lower($market, 'symbolDesc');
$baseId = strtolower($uppercaseBaseId);
$lowercaseId = $baseId . '_' . $quoteId;
$base = $this->safe_currency_code($uppercaseBaseId);
Expand Down Expand Up @@ -1050,11 +1059,12 @@ public function withdraw ($code, $amount, $address, $tag = null, $params = array

public function sign ($path, $api = 'public', $method = 'GET', $params = array (), $headers = null, $body = null) {
$url = '/';
if ($api !== 'web') {
$isWebApi = ($api === 'web') || ($api === 'v3');
if (!$isWebApi) {
$url .= $this->version . '/';
}
$url .= $path;
if ($api !== 'web') {
if (!$isWebApi) {
$url .= $this->extension;
}
if ($api === 'private') {
Expand Down
1 change: 1 addition & 0 deletions php/okex.php
Expand Up @@ -22,6 +22,7 @@ public function describe () {
'urls' => array (
'logo' => 'https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg',
'api' => array (
'v3' => 'https://www.okex.com/v3',
'web' => 'https://www.okex.com/v2',
'public' => 'https://www.okex.com/api',
'private' => 'https://www.okex.com/api',
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Expand Up @@ -22,7 +22,7 @@

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

__version__ = '1.19.34'
__version__ = '1.19.35'

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

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

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

__version__ = '1.19.34'
__version__ = '1.19.35'

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

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

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

__version__ = '1.19.34'
__version__ = '1.19.35'

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

Expand Down
22 changes: 16 additions & 6 deletions python/ccxt/async_support/okcoinusd.py
Expand Up @@ -52,6 +52,11 @@ def describe(self):
'1w': '1week',
},
'api': {
'v3': {
'get': [
'futures/pc/market/futuresCoin',
],
},
'web': {
'get': [
'futures/pc/market/marketOverview',
Expand Down Expand Up @@ -131,6 +136,7 @@ def describe(self):
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/27766791-89ffb502-5ee5-11e7-8a5b-c5950b68ac65.jpg',
'api': {
'v3': 'https://www.okcoin.com/v3',
'web': 'https://www.okcoin.com/v2',
'public': 'https://www.okcoin.com/api',
'private': 'https://www.okcoin.com',
Expand Down Expand Up @@ -375,7 +381,9 @@ async def fetch_markets(self, params={}):
spotMarkets = self.safe_value(spotResponse, 'data', [])
markets = spotMarkets
if self.has['futures']:
futuresResponse = await self.webPostFuturesPcMarketFuturesCoin()
futuresResponse = await self.v3GetFuturesPcMarketFuturesCoin({
'currencyCode': 0,
})
#
# {
# "msg":"success",
Expand Down Expand Up @@ -409,7 +417,8 @@ async def fetch_markets(self, params={}):
# ]
# }
#
futuresMarkets = self.safe_value(futuresResponse, 'data', [])
data = self.safe_value(futuresResponse, 'data', {})
futuresMarkets = self.safe_value(data, 'usd', [])
markets = self.array_concat(spotMarkets, futuresMarkets)
for i in range(0, len(markets)):
market = markets[i]
Expand Down Expand Up @@ -443,8 +452,8 @@ async def fetch_markets(self, params={}):
contracts = [{}]
else:
# futures markets
quoteId = self.safe_string(market, 'quote')
uppercaseBaseId = self.safe_string(market, 'symbolDesc')
quoteId = self.safe_string_lower_2(market, 'quote', 'denomination')
uppercaseBaseId = self.safe_string_lower(market, 'symbolDesc')
baseId = uppercaseBaseId.lower()
lowercaseId = baseId + '_' + quoteId
base = self.safe_currency_code(uppercaseBaseId)
Expand Down Expand Up @@ -984,10 +993,11 @@ async def withdraw(self, code, amount, address, tag=None, params={}):

def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
url = '/'
if api != 'web':
isWebApi = (api == 'web') or (api == 'v3')
if not isWebApi:
url += self.version + '/'
url += path
if api != 'web':
if not isWebApi:
url += self.extension
if api == 'private':
self.check_required_credentials()
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/async_support/okex.py
Expand Up @@ -21,6 +21,7 @@ def describe(self):
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/32552768-0d6dd3c6-c4a6-11e7-90f8-c043b64756a7.jpg',
'api': {
'v3': 'https://www.okex.com/v3',
'web': 'https://www.okex.com/v2',
'public': 'https://www.okex.com/api',
'private': 'https://www.okex.com/api',
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/base/exchange.py
Expand Up @@ -4,7 +4,7 @@

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

__version__ = '1.19.34'
__version__ = '1.19.35'

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

Expand Down
22 changes: 16 additions & 6 deletions python/ccxt/okcoinusd.py

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

0 comments on commit a08bbb6

Please sign in to comment.