Skip to content

Commit

Permalink
1.13.143
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed May 14, 2018
1 parent 6512725 commit 1e1b120
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 26 deletions.
22 changes: 15 additions & 7 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.13.142'
const version = '1.13.143'

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.13.142",
"version": "1.13.143",
"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.13.142';
$version = '1.13.143';

// rounding mode
const TRUNCATE = 0;
Expand Down
12 changes: 10 additions & 2 deletions php/cobinhood.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public function describe () {
'amount' => 8,
'price' => 8,
),
'exceptions' => array (
'insufficient_balance' => '\\ccxt\\InsufficientFunds',
),
));
}

Expand Down Expand Up @@ -560,7 +563,12 @@ public function handle_errors ($code, $reason, $url, $method, $headers, $body) {
throw new ExchangeError ($this->id . ' ' . $body);
}
$response = json_decode ($body, $as_associative_array = true);
$message = $this->safe_value($response['error'], 'error_code');
throw new ExchangeError ($this->id . ' ' . $message);
$error_code = $this->safe_value($response['error'], 'error_code');
$feedback = $this->id . ' ' . $this->json ($response);
$exceptions = $this->exceptions;
if (is_array ($exceptions) && array_key_exists ($error_code, $exceptions)) {
throw new $exceptions[$code] ($feedback);
}
throw new ExchangeError ($feedback);
}
}
2 changes: 1 addition & 1 deletion php/coinegg.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function fetch_ticker ($symbol, $params = array ()) {

public function fetch_tickers ($symbols = null, $params = array ()) {
$this->load_markets();
$quoteIds = array ( 'btc', 'usc' );
$quoteIds = $this->options['quoteIds'];
$result = array ();
for ($b = 0; $b < count ($quoteIds); $b++) {
$quoteId = $quoteIds[$b];
Expand Down
2 changes: 1 addition & 1 deletion php/lbank.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function parse_ticker ($ticker, $market = null) {
'percentage' => null,
'average' => null,
'baseVolume' => $this->safe_float($ticker, 'vol'),
'quoteVolume' => null,
'quoteVolume' => $this->safe_float($ticker, 'turnover'),
'info' => $info,
);
}
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.13.142'
__version__ = '1.13.143'

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

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.13.142'
__version__ = '1.13.143'

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

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.13.142'
__version__ = '1.13.143'

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

Expand Down
12 changes: 10 additions & 2 deletions python/ccxt/async/cobinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ccxt.async.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import InsufficientFunds


class cobinhood (Exchange):
Expand Down Expand Up @@ -128,6 +129,9 @@ def describe(self):
'amount': 8,
'price': 8,
},
'exceptions': {
'insufficient_balance': InsufficientFunds,
},
})

async def fetch_currencies(self, params={}):
Expand Down Expand Up @@ -527,5 +531,9 @@ def handle_errors(self, code, reason, url, method, headers, body):
if body[0] != '{':
raise ExchangeError(self.id + ' ' + body)
response = json.loads(body)
message = self.safe_value(response['error'], 'error_code')
raise ExchangeError(self.id + ' ' + message)
error_code = self.safe_value(response['error'], 'error_code')
feedback = self.id + ' ' + self.json(response)
exceptions = self.exceptions
if error_code in exceptions:
raise exceptions[code](feedback)
raise ExchangeError(feedback)
2 changes: 1 addition & 1 deletion python/ccxt/async/coinegg.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ async def fetch_ticker(self, symbol, params={}):

async def fetch_tickers(self, symbols=None, params={}):
await self.load_markets()
quoteIds = ['btc', 'usc']
quoteIds = self.options['quoteIds']
result = {}
for b in range(0, len(quoteIds)):
quoteId = quoteIds[b]
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async/lbank.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def parse_ticker(self, ticker, market=None):
'percentage': None,
'average': None,
'baseVolume': self.safe_float(ticker, 'vol'),
'quoteVolume': None,
'quoteVolume': self.safe_float(ticker, 'turnover'),
'info': info,
}

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.13.142'
__version__ = '1.13.143'

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

Expand Down
12 changes: 10 additions & 2 deletions python/ccxt/cobinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import InsufficientFunds


class cobinhood (Exchange):
Expand Down Expand Up @@ -128,6 +129,9 @@ def describe(self):
'amount': 8,
'price': 8,
},
'exceptions': {
'insufficient_balance': InsufficientFunds,
},
})

def fetch_currencies(self, params={}):
Expand Down Expand Up @@ -527,5 +531,9 @@ def handle_errors(self, code, reason, url, method, headers, body):
if body[0] != '{':
raise ExchangeError(self.id + ' ' + body)
response = json.loads(body)
message = self.safe_value(response['error'], 'error_code')
raise ExchangeError(self.id + ' ' + message)
error_code = self.safe_value(response['error'], 'error_code')
feedback = self.id + ' ' + self.json(response)
exceptions = self.exceptions
if error_code in exceptions:
raise exceptions[code](feedback)
raise ExchangeError(feedback)
2 changes: 1 addition & 1 deletion python/ccxt/coinegg.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def fetch_ticker(self, symbol, params={}):

def fetch_tickers(self, symbols=None, params={}):
self.load_markets()
quoteIds = ['btc', 'usc']
quoteIds = self.options['quoteIds']
result = {}
for b in range(0, len(quoteIds)):
quoteId = quoteIds[b]
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/lbank.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def parse_ticker(self, ticker, market=None):
'percentage': None,
'average': None,
'baseVolume': self.safe_float(ticker, 'vol'),
'quoteVolume': None,
'quoteVolume': self.safe_float(ticker, 'turnover'),
'info': info,
}

Expand Down

0 comments on commit 1e1b120

Please sign in to comment.