Skip to content

Commit

Permalink
1.10.782
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Jan 20, 2018
1 parent 7e5cf9f commit 5c12ab1
Show file tree
Hide file tree
Showing 53 changed files with 132 additions and 34 deletions.
42 changes: 33 additions & 9 deletions build/ccxt.browser.js

Large diffs are not rendered by default.

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 errors = require ('./js/base/errors')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.10.781'
const version = '1.10.782'

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

namespace ccxt;

$version = '1.10.781';
$version = '1.10.782';

abstract class Exchange {

Expand Down
1 change: 1 addition & 0 deletions php/bibox.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function describe () {
'has' => array (
'fetchBalance' => true,
'fetchCurrencies' => true,
'fetchDepositAddress' => true,
'fetchTickers' => true,
'fetchOrders' => true,
'fetchMyTrades' => true,
Expand Down
1 change: 1 addition & 0 deletions php/binance.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function describe () {
'hasWithdraw' => true,
// new metainfo interface
'has' => array (
'fetchDepositAddress' => true,
'fetchBidsAsks' => true,
'fetchTickers' => true,
'fetchOHLCV' => true,
Expand Down
2 changes: 2 additions & 0 deletions php/bitfinex.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function describe () {
'hasFetchClosedOrders' => true,
// new metainfo interface
'has' => array (
'createDepositAddress' => true,
'fetchDepositAddress' => true,
'fetchOHLCV' => true,
'fetchTickers' => true,
'fetchOrder' => true,
Expand Down
1 change: 1 addition & 0 deletions php/bittrex.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function describe () {
'hasWithdraw' => true,
// new metainfo interface
'has' => array (
'fetchDepositAddress' => true,
'fetchTickers' => true,
'fetchOHLCV' => true,
'fetchOrder' => true,
Expand Down
1 change: 1 addition & 0 deletions php/braziliex.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function describe () {
'hasFetchMyTrades' => true,
// new metainfo interface
'has' => array (
'fetchDepositAddress' => true,
'fetchTickers' => true,
'fetchOpenOrders' => true,
'fetchMyTrades' => true,
Expand Down
1 change: 1 addition & 0 deletions php/cryptopia.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function describe () {
'hasWithdraw' => true,
// new metainfo interface
'has' => array (
'fetchDepositAddress' => true,
'fetchTickers' => true,
'fetchOrder' => 'emulated',
'fetchOrders' => 'emulated',
Expand Down
11 changes: 7 additions & 4 deletions php/gdax.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,17 @@ public function handle_errors ($code, $reason, $url, $method, $headers, $body) {
if ($body[0] === '{') {
$response = json_decode ($body, $as_associative_array = true);
$message = $response['message'];
$error = $this->id . ' ' . $message;
if (mb_strpos ($message, 'price too small') !== false) {
throw new InvalidOrder ($this->id . ' ' . $message);
throw new InvalidOrder ($error);
} else if (mb_strpos ($message, 'price too precise') !== false) {
throw new InvalidOrder ($this->id . ' ' . $message);
throw new InvalidOrder ($error);
} else if ($message === 'Insufficient funds') {
throw new InsufficientFunds ($error);
} else if ($message === 'Invalid API Key') {
throw new AuthenticationError ($this->id . ' ' . $message);
throw new AuthenticationError ($error);
}
throw new ExchangeError ($this->id . ' ' . $this->json ($response));
throw new ExchangeError ($this->id . ' ' . $message);
}
throw new ExchangeError ($this->id . ' ' . $body);
}
Expand Down
2 changes: 2 additions & 0 deletions php/hitbtc2.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public function describe () {
'hasFetchCurrencies' => true,
// new metainfo interface
'has' => array (
'createDepositAddress' => true,
'fetchDepositAddress' => true,
'fetchCurrencies' => true,
'fetchOHLCV' => true,
'fetchTickers' => true,
Expand Down
2 changes: 2 additions & 0 deletions php/kraken.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public function describe () {
'hasFetchCurrencies' => true,
// new metainfo interface
'has' => array (
'createDepositAddress' => true,
'fetchDepositAddress' => true,
'fetchCurrencies' => true,
'fetchTickers' => true,
'fetchOHLCV' => true,
Expand Down
2 changes: 1 addition & 1 deletion php/liqui.php
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,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') || (strlen ($body) < 2))
if ((gettype ($body) != 'string') && $body && (strlen ($body) < 2))
return; // fallback to default error handler
if (($body[0] === '{') || ($body[0] === '[')) {
$response = json_decode ($body, $as_associative_array = true);
Expand Down
1 change: 1 addition & 0 deletions php/livecoin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function describe () {
'hasFetchCurrencies' => true,
// new metainfo interface
'has' => array (
'fetchDepositAddress' => true,
'fetchTickers' => true,
'fetchCurrencies' => true,
),
Expand Down
2 changes: 2 additions & 0 deletions php/poloniex.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public function describe () {
'hasFetchOHLCV' => true,
// new metainfo interface
'has' => array (
'createDepositAddress' => true,
'fetchDepositAddress' => true,
'fetchOHLCV' => true,
'fetchMyTrades' => true,
'fetchOrder' => 'emulated',
Expand Down
1 change: 1 addition & 0 deletions php/quadrigacx.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function describe () {
'hasWithdraw' => true,
// new metainfo interface
'has' => array (
'fetchDepositAddress' => true,
'withdraw' => true,
),
'urls' => array (
Expand Down
6 changes: 6 additions & 0 deletions php/yobit.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ public function describe () {
'countries' => 'RU',
'rateLimit' => 3000, // responses are cached every 2 seconds
'version' => '3',
// obsolete metainfo interface
'hasCORS' => false,
'hasWithdraw' => true,
// new metainfo interface
'has' => array (
'createDepositAddress' => true,
'fetchDepositAddress' => true,
),
'urls' => array (
'logo' => 'https://user-images.githubusercontent.com/1294454/27766910-cdcbfdae-5eea-11e7-9859-03fea873272d.jpg',
'api' => array (
Expand Down
2 changes: 1 addition & 1 deletion php/zb.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public function sign ($path, $api = 'public', $method = 'GET', $params = array (
$this->check_required_credentials();
$nonce = $this->nonce ();
$auth = 'accesskey=' . $this->apiKey;
$auth .= '&$method=' . $path;
$auth .= '&' . 'method=' . $path;
$secret = $this->hash ($this->encode ($this->secret), 'sha1');
$signature = $this->hmac ($this->encode ($auth), $this->encode ($secret), 'md5');
$suffix = 'sign=' . $signature . '&reqTime=' . (string) $nonce;
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

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

__version__ = '1.10.781'
__version__ = '1.10.782'

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

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

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

__version__ = '1.10.781'
__version__ = '1.10.782'

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

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

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

__version__ = '1.10.781'
__version__ = '1.10.782'

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

Expand Down
1 change: 1 addition & 0 deletions python/ccxt/async/bibox.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def describe(self):
'has': {
'fetchBalance': True,
'fetchCurrencies': True,
'fetchDepositAddress': True,
'fetchTickers': True,
'fetchOrders': True,
'fetchMyTrades': True,
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/async/binance.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def describe(self):
'hasWithdraw': True,
# new metainfo interface
'has': {
'fetchDepositAddress': True,
'fetchBidsAsks': True,
'fetchTickers': True,
'fetchOHLCV': True,
Expand Down
2 changes: 2 additions & 0 deletions python/ccxt/async/bitfinex.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def describe(self):
'hasFetchClosedOrders': True,
# new metainfo interface
'has': {
'createDepositAddress': True,
'fetchDepositAddress': True,
'fetchOHLCV': True,
'fetchTickers': True,
'fetchOrder': True,
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/async/bittrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def describe(self):
'hasWithdraw': True,
# new metainfo interface
'has': {
'fetchDepositAddress': True,
'fetchTickers': True,
'fetchOHLCV': True,
'fetchOrder': True,
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/async/braziliex.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def describe(self):
'hasFetchMyTrades': True,
# new metainfo interface
'has': {
'fetchDepositAddress': True,
'fetchTickers': True,
'fetchOpenOrders': True,
'fetchMyTrades': True,
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/async/cryptopia.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def describe(self):
'hasWithdraw': True,
# new metainfo interface
'has': {
'fetchDepositAddress': True,
'fetchTickers': True,
'fetchOrder': 'emulated',
'fetchOrders': 'emulated',
Expand Down
12 changes: 8 additions & 4 deletions python/ccxt/async/gdax.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NotSupported
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder


Expand Down Expand Up @@ -503,13 +504,16 @@ def handle_errors(self, code, reason, url, method, headers, body):
if body[0] == '{':
response = json.loads(body)
message = response['message']
error = self.id + ' ' + message
if message.find('price too small') >= 0:
raise InvalidOrder(self.id + ' ' + message)
raise InvalidOrder(error)
elif message.find('price too precise') >= 0:
raise InvalidOrder(self.id + ' ' + message)
raise InvalidOrder(error)
elif message == 'Insufficient funds':
raise InsufficientFunds(error)
elif message == 'Invalid API Key':
raise AuthenticationError(self.id + ' ' + message)
raise ExchangeError(self.id + ' ' + self.json(response))
raise AuthenticationError(error)
raise ExchangeError(self.id + ' ' + message)
raise ExchangeError(self.id + ' ' + body)

async def request(self, path, api='public', method='GET', params={}, headers=None, body=None):
Expand Down
2 changes: 2 additions & 0 deletions python/ccxt/async/hitbtc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def describe(self):
'hasFetchCurrencies': True,
# new metainfo interface
'has': {
'createDepositAddress': True,
'fetchDepositAddress': True,
'fetchCurrencies': True,
'fetchOHLCV': True,
'fetchTickers': True,
Expand Down
2 changes: 2 additions & 0 deletions python/ccxt/async/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def describe(self):
'hasFetchCurrencies': True,
# new metainfo interface
'has': {
'createDepositAddress': True,
'fetchDepositAddress': True,
'fetchCurrencies': True,
'fetchTickers': True,
'fetchOHLCV': True,
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async/liqui.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def sign(self, path, api='public', method='GET', params={}, headers=None, body=N
return {'url': url, 'method': method, 'body': body, 'headers': headers}

def handle_errors(self, httpCode, reason, url, method, headers, body):
if (not isinstance(body, basestring)) or len((body) < 2):
if (not isinstance(body, basestring)) and body and len((body) < 2):
return # fallback to default error handler
if (body[0] == '{') or (body[0] == '['):
response = json.loads(body)
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/async/livecoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def describe(self):
'hasFetchCurrencies': True,
# new metainfo interface
'has': {
'fetchDepositAddress': True,
'fetchTickers': True,
'fetchCurrencies': True,
},
Expand Down
2 changes: 2 additions & 0 deletions python/ccxt/async/poloniex.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def describe(self):
'hasFetchOHLCV': True,
# new metainfo interface
'has': {
'createDepositAddress': True,
'fetchDepositAddress': True,
'fetchOHLCV': True,
'fetchMyTrades': True,
'fetchOrder': 'emulated',
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/async/quadrigacx.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def describe(self):
'hasWithdraw': True,
# new metainfo interface
'has': {
'fetchDepositAddress': True,
'withdraw': True,
},
'urls': {
Expand Down
6 changes: 6 additions & 0 deletions python/ccxt/async/yobit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ def describe(self):
'countries': 'RU',
'rateLimit': 3000, # responses are cached every 2 seconds
'version': '3',
# obsolete metainfo interface
'hasCORS': False,
'hasWithdraw': True,
# new metainfo interface
'has': {
'createDepositAddress': True,
'fetchDepositAddress': True,
},
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/27766910-cdcbfdae-5eea-11e7-9859-03fea873272d.jpg',
'api': {
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async/zb.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def sign(self, path, api='public', method='GET', params={}, headers=None, body=N
self.check_required_credentials()
nonce = self.nonce()
auth = 'accesskey=' + self.apiKey
auth += '&method=' + path
auth += '&' + 'method=' + path
secret = self.hash(self.encode(self.secret), 'sha1')
signature = self.hmac(self.encode(auth), self.encode(secret), hashlib.md5)
suffix = 'sign=' + signature + '&reqTime=' + str(nonce)
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.10.781'
__version__ = '1.10.782'

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

Expand Down
1 change: 1 addition & 0 deletions python/ccxt/bibox.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def describe(self):
'has': {
'fetchBalance': True,
'fetchCurrencies': True,
'fetchDepositAddress': True,
'fetchTickers': True,
'fetchOrders': True,
'fetchMyTrades': True,
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/binance.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def describe(self):
'hasWithdraw': True,
# new metainfo interface
'has': {
'fetchDepositAddress': True,
'fetchBidsAsks': True,
'fetchTickers': True,
'fetchOHLCV': True,
Expand Down
2 changes: 2 additions & 0 deletions python/ccxt/bitfinex.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def describe(self):
'hasFetchClosedOrders': True,
# new metainfo interface
'has': {
'createDepositAddress': True,
'fetchDepositAddress': True,
'fetchOHLCV': True,
'fetchTickers': True,
'fetchOrder': True,
Expand Down
1 change: 1 addition & 0 deletions python/ccxt/bittrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def describe(self):
'hasWithdraw': True,
# new metainfo interface
'has': {
'fetchDepositAddress': True,
'fetchTickers': True,
'fetchOHLCV': True,
'fetchOrder': True,
Expand Down
Loading

0 comments on commit 5c12ab1

Please sign in to comment.