Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ccxt-dev/ccxt
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jul 6, 2018
2 parents d2311c4 + 2273693 commit 5e92903
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 17 deletions.
16 changes: 12 additions & 4 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 Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.15.19'
const version = '1.15.20'

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.15.19",
"version": "1.15.20",
"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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace ccxt;

$version = '1.15.19';
$version = '1.15.20';

// rounding mode
const TRUNCATE = 0;
Expand Down
12 changes: 10 additions & 2 deletions php/cointiger.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public function describe () {
),
),
'exceptions' => array (
'1' => '\\ccxt\\InsufficientFunds',
// array ("code":"1","msg":"系统错误","data":null)
// array (“code”:“1",“msg”:“Balance insufficient,余额不足“,”data”:null)
'1' => '\\ccxt\\ExchangeError',
'2' => '\\ccxt\\ExchangeError',
'5' => '\\ccxt\\InvalidOrder',
'6' => '\\ccxt\\InvalidOrder',
Expand Down Expand Up @@ -598,7 +600,13 @@ public function handle_errors ($httpCode, $reason, $url, $method, $headers, $bod
$feedback = $this->id . ' ' . $this->json ($response);
$exceptions = $this->exceptions;
if (is_array ($exceptions) && array_key_exists ($code, $exceptions)) {
if ($code === 2) {
if ($code === 1) {
// array ("$code":"1","msg":"系统错误","data":null)
// array (“$code”:“1",“msg”:“Balance insufficient,余额不足“,”data”:null)
if (mb_strpos ($message, 'Balance insufficient') !== false) {
throw new InsufficientFunds ($feedback);
}
} else if ($code === 2) {
if ($message === 'offsetNot Null') {
throw new ExchangeError ($feedback);
} else if ($message === 'Parameter error') {
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.15.19'
__version__ = '1.15.20'

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

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.15.19'
__version__ = '1.15.20'

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

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.15.19'
__version__ = '1.15.20'

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

Expand Down
11 changes: 9 additions & 2 deletions python/ccxt/async/cointiger.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def describe(self):
},
},
'exceptions': {
'1': InsufficientFunds,
# {"code":"1","msg":"系统错误","data":null}
# {“code”:“1",“msg”:“Balance insufficient,余额不足“,”data”:null}
'1': ExchangeError,
'2': ExchangeError,
'5': InvalidOrder,
'6': InvalidOrder,
Expand Down Expand Up @@ -575,7 +577,12 @@ def handle_errors(self, httpCode, reason, url, method, headers, body):
feedback = self.id + ' ' + self.json(response)
exceptions = self.exceptions
if code in exceptions:
if code == 2:
if code == 1:
# {"code":"1","msg":"系统错误","data":null}
# {“code”:“1",“msg”:“Balance insufficient,余额不足“,”data”:null}
if message.find('Balance insufficient') >= 0:
raise InsufficientFunds(feedback)
elif code == 2:
if message == 'offsetNot Null':
raise ExchangeError(feedback)
elif message == 'Parameter error':
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.15.19'
__version__ = '1.15.20'

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

Expand Down
11 changes: 9 additions & 2 deletions python/ccxt/cointiger.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def describe(self):
},
},
'exceptions': {
'1': InsufficientFunds,
# {"code":"1","msg":"系统错误","data":null}
# {“code”:“1",“msg”:“Balance insufficient,余额不足“,”data”:null}
'1': ExchangeError,
'2': ExchangeError,
'5': InvalidOrder,
'6': InvalidOrder,
Expand Down Expand Up @@ -575,7 +577,12 @@ def handle_errors(self, httpCode, reason, url, method, headers, body):
feedback = self.id + ' ' + self.json(response)
exceptions = self.exceptions
if code in exceptions:
if code == 2:
if code == 1:
# {"code":"1","msg":"系统错误","data":null}
# {“code”:“1",“msg”:“Balance insufficient,余额不足“,”data”:null}
if message.find('Balance insufficient') >= 0:
raise InsufficientFunds(feedback)
elif code == 2:
if message == 'offsetNot Null':
raise ExchangeError(feedback)
elif message == 'Parameter error':
Expand Down

0 comments on commit 5e92903

Please sign in to comment.