Skip to content

Commit

Permalink
1.14.118
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Jun 1, 2018
1 parent 530fa87 commit 6c6214e
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 46 deletions.
39 changes: 27 additions & 12 deletions build/ccxt.browser.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ccxt.js
Expand Up @@ -37,7 +37,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.14.117'
const version = '1.14.118'

Exchange.ccxtVersion = version

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.14.117",
"version": "1.14.118",
"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
Expand Up @@ -30,7 +30,7 @@

namespace ccxt;

$version = '1.14.117';
$version = '1.14.118';

// rounding mode
const TRUNCATE = 0;
Expand Down
31 changes: 23 additions & 8 deletions php/coinfloor.php
Expand Up @@ -68,17 +68,32 @@ public function describe () {
}

public function fetch_balance ($params = array ()) {
$symbol = null;
$market = null;
if (is_array ($params) && array_key_exists ('symbol', $params))
$symbol = $params['symbol'];
$market = $this->find_market($params['symbol']);
if (is_array ($params) && array_key_exists ('id', $params))
$symbol = $params['id'];
if (!$symbol)
throw new ExchangeError ($this->id . ' fetchBalance requires a $symbol param');
// todo parse balance
return $this->privatePostIdBalance (array (
'id' => $this->market_id($symbol),
$market = $this->find_market($params['id']);
if (!$market)
throw new NotSupported ($this->id . ' fetchBalance requires a symbol param');
$response = $this->privatePostIdBalance (array (
'id' => $market['id'],
));
$result = array (
'info' => $response,
);
// base/quote used for $keys e.g. "xbt_reserved"
$keys = strtolower (explode ('/', $market['id']));
$result[$market['base']] = array (
'free' => floatval ($response[$keys[0] . '_available']),
'used' => floatval ($response[$keys[0] . '_reserved']),
'total' => floatval ($response[$keys[0] . '_balance']),
);
$result[$market['quote']] = array (
'free' => floatval ($response[$keys[1] . '_available']),
'used' => floatval ($response[$keys[1] . '_reserved']),
'total' => floatval ($response[$keys[1] . '_balance']),
);
return $this->parse_balance($result);
}

public function fetch_order_book ($symbol, $limit = null, $params = array ()) {
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Expand Up @@ -22,7 +22,7 @@

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

__version__ = '1.14.117'
__version__ = '1.14.118'

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

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

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

__version__ = '1.14.117'
__version__ = '1.14.118'

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

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

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

__version__ = '1.14.117'
__version__ = '1.14.118'

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

Expand Down
34 changes: 24 additions & 10 deletions python/ccxt/async/coinfloor.py
Expand Up @@ -5,7 +5,6 @@

from ccxt.async.base.exchange import Exchange
import base64
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NotSupported


Expand Down Expand Up @@ -68,18 +67,33 @@ def describe(self):
},
})

def fetch_balance(self, params={}):
symbol = None
async def fetch_balance(self, params={}):
market = None
if 'symbol' in params:
symbol = params['symbol']
market = self.find_market(params['symbol'])
if 'id' in params:
symbol = params['id']
if not symbol:
raise ExchangeError(self.id + ' fetchBalance requires a symbol param')
# todo parse balance
return self.privatePostIdBalance({
'id': self.market_id(symbol),
market = self.find_market(params['id'])
if not market:
raise NotSupported(self.id + ' fetchBalance requires a symbol param')
response = await self.privatePostIdBalance({
'id': market['id'],
})
result = {
'info': response,
}
# base/quote used for keys e.g. "xbt_reserved"
keys = market['id'].lower().split('/')
result[market['base']] = {
'free': float(response[keys[0] + '_available']),
'used': float(response[keys[0] + '_reserved']),
'total': float(response[keys[0] + '_balance']),
}
result[market['quote']] = {
'free': float(response[keys[1] + '_available']),
'used': float(response[keys[1] + '_reserved']),
'total': float(response[keys[1] + '_balance']),
}
return self.parse_balance(result)

async def fetch_order_book(self, symbol, limit=None, params={}):
orderbook = await self.publicGetIdOrderBook(self.extend({
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/base/exchange.py
Expand Up @@ -4,7 +4,7 @@

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

__version__ = '1.14.117'
__version__ = '1.14.118'

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

Expand Down
32 changes: 23 additions & 9 deletions python/ccxt/coinfloor.py
Expand Up @@ -5,7 +5,6 @@

from ccxt.base.exchange import Exchange
import base64
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NotSupported


Expand Down Expand Up @@ -69,17 +68,32 @@ def describe(self):
})

def fetch_balance(self, params={}):
symbol = None
market = None
if 'symbol' in params:
symbol = params['symbol']
market = self.find_market(params['symbol'])
if 'id' in params:
symbol = params['id']
if not symbol:
raise ExchangeError(self.id + ' fetchBalance requires a symbol param')
# todo parse balance
return self.privatePostIdBalance({
'id': self.market_id(symbol),
market = self.find_market(params['id'])
if not market:
raise NotSupported(self.id + ' fetchBalance requires a symbol param')
response = self.privatePostIdBalance({
'id': market['id'],
})
result = {
'info': response,
}
# base/quote used for keys e.g. "xbt_reserved"
keys = market['id'].lower().split('/')
result[market['base']] = {
'free': float(response[keys[0] + '_available']),
'used': float(response[keys[0] + '_reserved']),
'total': float(response[keys[0] + '_balance']),
}
result[market['quote']] = {
'free': float(response[keys[1] + '_available']),
'used': float(response[keys[1] + '_reserved']),
'total': float(response[keys[1] + '_balance']),
}
return self.parse_balance(result)

def fetch_order_book(self, symbol, limit=None, params={}):
orderbook = self.publicGetIdOrderBook(self.extend({
Expand Down

0 comments on commit 6c6214e

Please sign in to comment.