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 Jun 3, 2018
2 parents f7eb169 + 8b13bc1 commit 433bf90
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 14 deletions.
11 changes: 8 additions & 3 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.120'
const version = '1.14.122'

Exchange.ccxtVersion = version

Expand Down
7 changes: 6 additions & 1 deletion js/gateio.js
Expand Up @@ -25,6 +25,7 @@ module.exports = class gateio extends Exchange {
'fetchClosedOrders': true,
'fetchOpenOrders': true,
'fetchOrders': true,
'fetchOrder': true,
},
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/31784029-0313c702-b509-11e7-9ccc-bc0da6a0e435.jpg',
Expand Down Expand Up @@ -319,7 +320,7 @@ module.exports = class gateio extends Exchange {

async fetchOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) {
let response = await this.privatePostOpenOrders (params);
return this.parseOrders (response['result']['orders'], undefined, since, limit);
return this.parseOrders (response['orders'], undefined, since, limit);
}

async fetchOrder (id, symbol = undefined, params = {}) {
Expand Down Expand Up @@ -364,6 +365,10 @@ module.exports = class gateio extends Exchange {
let amount = this.safeFloat (order, 'initialAmount');
let filled = this.safeFloat (order, 'filledAmount');
let remaining = this.safeFloat (order, 'leftAmount');
if (typeof remaining === 'undefined') {
// In the order status response, this field has a different name.
remaining = this.safeFloat (order, 'left');
}
let feeCost = this.safeFloat (order, 'feeValue');
let feeCurrency = this.safeString (order, 'feeCurrency');
if (typeof feeCurrency !== 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.14.120",
"version": "1.14.122",
"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.120';
$version = '1.14.122';

// rounding mode
const TRUNCATE = 0;
Expand Down
7 changes: 6 additions & 1 deletion php/gateio.php
Expand Up @@ -26,6 +26,7 @@ public function describe () {
'fetchClosedOrders' => true,
'fetchOpenOrders' => true,
'fetchOrders' => true,
'fetchOrder' => true,
),
'urls' => array (
'logo' => 'https://user-images.githubusercontent.com/1294454/31784029-0313c702-b509-11e7-9ccc-bc0da6a0e435.jpg',
Expand Down Expand Up @@ -320,7 +321,7 @@ public function fetch_trades ($symbol, $since = null, $limit = null, $params = a

public function fetch_orders ($symbol = null, $since = null, $limit = null, $params = array ()) {
$response = $this->privatePostOpenOrders ($params);
return $this->parse_orders($response['result']['orders'], null, $since, $limit);
return $this->parse_orders($response['orders'], null, $since, $limit);
}

public function fetch_order ($id, $symbol = null, $params = array ()) {
Expand Down Expand Up @@ -365,6 +366,10 @@ public function parse_order ($order, $market = null) {
$amount = $this->safe_float($order, 'initialAmount');
$filled = $this->safe_float($order, 'filledAmount');
$remaining = $this->safe_float($order, 'leftAmount');
if ($remaining === null) {
// In the $order $status response, this field has a different name.
$remaining = $this->safe_float($order, 'left');
}
$feeCost = $this->safe_float($order, 'feeValue');
$feeCurrency = $this->safe_string($order, 'feeCurrency');
if ($feeCurrency !== null) {
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Expand Up @@ -22,7 +22,7 @@

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

__version__ = '1.14.120'
__version__ = '1.14.122'

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

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

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

__version__ = '1.14.120'
__version__ = '1.14.122'

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

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

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

__version__ = '1.14.120'
__version__ = '1.14.122'

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

Expand Down
6 changes: 5 additions & 1 deletion python/ccxt/async/gateio.py
Expand Up @@ -41,6 +41,7 @@ def describe(self):
'fetchClosedOrders': True,
'fetchOpenOrders': True,
'fetchOrders': True,
'fetchOrder': True,
},
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/31784029-0313c702-b509-11e7-9ccc-bc0da6a0e435.jpg',
Expand Down Expand Up @@ -312,7 +313,7 @@ async def fetch_trades(self, symbol, since=None, limit=None, params={}):

async def fetch_orders(self, symbol=None, since=None, limit=None, params={}):
response = await self.privatePostOpenOrders(params)
return self.parse_orders(response['result']['orders'], None, since, limit)
return self.parse_orders(response['orders'], None, since, limit)

async def fetch_order(self, id, symbol=None, params={}):
await self.load_markets()
Expand Down Expand Up @@ -352,6 +353,9 @@ def parse_order(self, order, market=None):
amount = self.safe_float(order, 'initialAmount')
filled = self.safe_float(order, 'filledAmount')
remaining = self.safe_float(order, 'leftAmount')
if remaining is None:
# In the order status response, self field has a different name.
remaining = self.safe_float(order, 'left')
feeCost = self.safe_float(order, 'feeValue')
feeCurrency = self.safe_string(order, 'feeCurrency')
if feeCurrency is not None:
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/base/exchange.py
Expand Up @@ -4,7 +4,7 @@

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

__version__ = '1.14.120'
__version__ = '1.14.122'

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

Expand Down
6 changes: 5 additions & 1 deletion python/ccxt/gateio.py
Expand Up @@ -41,6 +41,7 @@ def describe(self):
'fetchClosedOrders': True,
'fetchOpenOrders': True,
'fetchOrders': True,
'fetchOrder': True,
},
'urls': {
'logo': 'https://user-images.githubusercontent.com/1294454/31784029-0313c702-b509-11e7-9ccc-bc0da6a0e435.jpg',
Expand Down Expand Up @@ -312,7 +313,7 @@ def fetch_trades(self, symbol, since=None, limit=None, params={}):

def fetch_orders(self, symbol=None, since=None, limit=None, params={}):
response = self.privatePostOpenOrders(params)
return self.parse_orders(response['result']['orders'], None, since, limit)
return self.parse_orders(response['orders'], None, since, limit)

def fetch_order(self, id, symbol=None, params={}):
self.load_markets()
Expand Down Expand Up @@ -352,6 +353,9 @@ def parse_order(self, order, market=None):
amount = self.safe_float(order, 'initialAmount')
filled = self.safe_float(order, 'filledAmount')
remaining = self.safe_float(order, 'leftAmount')
if remaining is None:
# In the order status response, self field has a different name.
remaining = self.safe_float(order, 'left')
feeCost = self.safe_float(order, 'feeValue')
feeCurrency = self.safe_string(order, 'feeCurrency')
if feeCurrency is not None:
Expand Down

0 comments on commit 433bf90

Please sign in to comment.