Skip to content

Commit

Permalink
1.17.394
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Oct 19, 2018
1 parent 0c431d1 commit c26a28a
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 38 deletions.
21 changes: 13 additions & 8 deletions build/ccxt.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.17.393'
const version = '1.17.394'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -52548,6 +52548,7 @@ module.exports = class theocean extends Exchange {
'CORS': false, // ?
'fetchTickers': true,
'fetchOHLCV': false,
'fetchOrder': true,
'fetchOrders': true,
'fetchOpenOrders': true,
'fetchClosedOrders': true,
Expand Down Expand Up @@ -53428,7 +53429,7 @@ module.exports = class theocean extends Exchange {
id = this.safeString (zeroExOrder, 'orderHash');
}
let side = this.safeString (order, 'side');
let type = 'limit';
let type = this.safeString (order, 'type'); // injected from outside
let timestamp = this.safeInteger (order, 'created');
timestamp = (timestamp !== undefined) ? timestamp * 1000 : timestamp;
let symbol = undefined;
Expand Down Expand Up @@ -53463,11 +53464,15 @@ module.exports = class theocean extends Exchange {
let lastTradeTimestamp = undefined;
let timeline = this.safeValue (order, 'timeline');
let trades = undefined;
let status = undefined;
if (timeline !== undefined) {
let numEvents = timeline.length;
if (numEvents > 0) {
// status = this.parseOrderStatus (this.safeString (timeline[numEvents - 1], 'action'));
let timelineEventsGroupedByAction = this.groupBy (timeline, 'action');
if ('error' in timelineEventsGroupedByAction) {
status = 'failed';
}
if ('placed' in timelineEventsGroupedByAction) {
let placeEvents = this.safeValue (timelineEventsGroupedByAction, 'placed');
if (amount === undefined) {
Expand All @@ -53480,7 +53485,6 @@ module.exports = class theocean extends Exchange {
timestamp = this.safeInteger (timelineEventsGroupedByAction['filled'][0], 'timestamp');
timestamp = (timestamp !== undefined) ? timestamp * 1000 : timestamp;
}
type = 'market';
}
if ('filled' in timelineEventsGroupedByAction) {
let fillEvents = this.safeValue (timelineEventsGroupedByAction, 'filled');
Expand Down Expand Up @@ -53536,13 +53540,14 @@ module.exports = class theocean extends Exchange {
'сurrency': feeCurrency,
};
}
let status = undefined;
let amountPrecision = market ? market['precision']['amount'] : 8;
if (remaining !== undefined) {
status = 'open';
const rest = remaining - failedAmount - deadAmount - prunedAmount;
if (rest < Math.pow (10, -amountPrecision)) {
status = (filled < amount) ? 'canceled' : 'closed';
if (status === undefined) {
status = 'open';
const rest = remaining - failedAmount - deadAmount - prunedAmount;
if (rest < Math.pow (10, -amountPrecision)) {
status = (filled < amount) ? 'canceled' : 'closed';
}
}
}
let result = {
Expand Down
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.17.393'
const version = '1.17.394'

Exchange.ccxtVersion = version

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.17.393",
"version": "1.17.394",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 100+ exchanges",
"main": "./ccxt.js",
"unpkg": "build/ccxt.browser.js",
Expand Down
4 changes: 2 additions & 2 deletions php/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use kornrunner\Secp256k1;
use kornrunner\Solidity;

$version = '1.17.393';
$version = '1.17.394';

// rounding mode
const TRUNCATE = 0;
Expand All @@ -50,7 +50,7 @@

class Exchange {

const VERSION = '1.17.393';
const VERSION = '1.17.394';

public static $eth_units = array (
'wei' => '1',
Expand Down
19 changes: 12 additions & 7 deletions php/theocean.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function describe () {
'CORS' => false, // ?
'fetchTickers' => true,
'fetchOHLCV' => false,
'fetchOrder' => true,
'fetchOrders' => true,
'fetchOpenOrders' => true,
'fetchClosedOrders' => true,
Expand Down Expand Up @@ -911,7 +912,7 @@ public function parse_order ($order, $market = null) {
$id = $this->safe_string($zeroExOrder, 'orderHash');
}
$side = $this->safe_string($order, 'side');
$type = 'limit';
$type = $this->safe_string($order, 'type'); // injected from outside
$timestamp = $this->safe_integer($order, 'created');
$timestamp = ($timestamp !== null) ? $timestamp * 1000 : $timestamp;
$symbol = null;
Expand Down Expand Up @@ -946,11 +947,15 @@ public function parse_order ($order, $market = null) {
$lastTradeTimestamp = null;
$timeline = $this->safe_value($order, 'timeline');
$trades = null;
$status = null;
if ($timeline !== null) {
$numEvents = is_array ($timeline) ? count ($timeline) : 0;
if ($numEvents > 0) {
// $status = $this->parse_order_status($this->safe_string($timeline[$numEvents - 1], 'action'));
$timelineEventsGroupedByAction = $this->group_by($timeline, 'action');
if (is_array ($timelineEventsGroupedByAction) && array_key_exists ('error', $timelineEventsGroupedByAction)) {
$status = 'failed';
}
if (is_array ($timelineEventsGroupedByAction) && array_key_exists ('placed', $timelineEventsGroupedByAction)) {
$placeEvents = $this->safe_value($timelineEventsGroupedByAction, 'placed');
if ($amount === null) {
Expand All @@ -963,7 +968,6 @@ public function parse_order ($order, $market = null) {
$timestamp = $this->safe_integer($timelineEventsGroupedByAction['filled'][0], 'timestamp');
$timestamp = ($timestamp !== null) ? $timestamp * 1000 : $timestamp;
}
$type = 'market';
}
if (is_array ($timelineEventsGroupedByAction) && array_key_exists ('filled', $timelineEventsGroupedByAction)) {
$fillEvents = $this->safe_value($timelineEventsGroupedByAction, 'filled');
Expand Down Expand Up @@ -1019,13 +1023,14 @@ public function parse_order ($order, $market = null) {
'сurrency' => $feeCurrency,
);
}
$status = null;
$amountPrecision = $market ? $market['precision']['amount'] : 8;
if ($remaining !== null) {
$status = 'open';
$rest = $remaining - $failedAmount - $deadAmount - $prunedAmount;
if ($rest < pow (10, -$amountPrecision)) {
$status = ($filled < $amount) ? 'canceled' : 'closed';
if ($status === null) {
$status = 'open';
$rest = $remaining - $failedAmount - $deadAmount - $prunedAmount;
if ($rest < pow (10, -$amountPrecision)) {
$status = ($filled < $amount) ? 'canceled' : 'closed';
}
}
}
$result = array (
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.17.393'
__version__ = '1.17.394'

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

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

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

__version__ = '1.17.393'
__version__ = '1.17.394'

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

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

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

__version__ = '1.17.393'
__version__ = '1.17.394'

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

Expand Down
17 changes: 10 additions & 7 deletions python/ccxt/async_support/theocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def describe(self):
'CORS': False, # ?
'fetchTickers': True,
'fetchOHLCV': False,
'fetchOrder': True,
'fetchOrders': True,
'fetchOpenOrders': True,
'fetchClosedOrders': True,
Expand Down Expand Up @@ -881,7 +882,7 @@ def parse_order(self, order, market=None):
if (id is None) and(zeroExOrder is not None):
id = self.safe_string(zeroExOrder, 'orderHash')
side = self.safe_string(order, 'side')
type = 'limit'
type = self.safe_string(order, 'type') # injected from outside
timestamp = self.safe_integer(order, 'created')
timestamp = timestamp * 1000 if (timestamp is not None) else timestamp
symbol = None
Expand Down Expand Up @@ -913,11 +914,14 @@ def parse_order(self, order, market=None):
lastTradeTimestamp = None
timeline = self.safe_value(order, 'timeline')
trades = None
status = None
if timeline is not None:
numEvents = len(timeline)
if numEvents > 0:
# status = self.parse_order_status(self.safe_string(timeline[numEvents - 1], 'action'))
timelineEventsGroupedByAction = self.group_by(timeline, 'action')
if 'error' in timelineEventsGroupedByAction:
status = 'failed'
if 'placed' in timelineEventsGroupedByAction:
placeEvents = self.safe_value(timelineEventsGroupedByAction, 'placed')
if amount is None:
Expand All @@ -928,7 +932,6 @@ def parse_order(self, order, market=None):
if 'filled' in timelineEventsGroupedByAction:
timestamp = self.safe_integer(timelineEventsGroupedByAction['filled'][0], 'timestamp')
timestamp = timestamp * 1000 if (timestamp is not None) else timestamp
type = 'market'
if 'filled' in timelineEventsGroupedByAction:
fillEvents = self.safe_value(timelineEventsGroupedByAction, 'filled')
numFillEvents = len(fillEvents)
Expand Down Expand Up @@ -971,13 +974,13 @@ def parse_order(self, order, market=None):
'сost': self.fromWei(feeCost, 'ether', feeDecimals),
'сurrency': feeCurrency,
}
status = None
amountPrecision = market['precision']['amount'] if market else 8
if remaining is not None:
status = 'open'
rest = remaining - failedAmount - deadAmount - prunedAmount
if rest < math.pow(10, -amountPrecision):
status = 'canceled' if (filled < amount) else 'closed'
if status is None:
status = 'open'
rest = remaining - failedAmount - deadAmount - prunedAmount
if rest < math.pow(10, -amountPrecision):
status = 'canceled' if (filled < amount) else 'closed'
result = {
'info': order,
'id': id,
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.17.393'
__version__ = '1.17.394'

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

Expand Down
17 changes: 10 additions & 7 deletions python/ccxt/theocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def describe(self):
'CORS': False, # ?
'fetchTickers': True,
'fetchOHLCV': False,
'fetchOrder': True,
'fetchOrders': True,
'fetchOpenOrders': True,
'fetchClosedOrders': True,
Expand Down Expand Up @@ -881,7 +882,7 @@ def parse_order(self, order, market=None):
if (id is None) and(zeroExOrder is not None):
id = self.safe_string(zeroExOrder, 'orderHash')
side = self.safe_string(order, 'side')
type = 'limit'
type = self.safe_string(order, 'type') # injected from outside
timestamp = self.safe_integer(order, 'created')
timestamp = timestamp * 1000 if (timestamp is not None) else timestamp
symbol = None
Expand Down Expand Up @@ -913,11 +914,14 @@ def parse_order(self, order, market=None):
lastTradeTimestamp = None
timeline = self.safe_value(order, 'timeline')
trades = None
status = None
if timeline is not None:
numEvents = len(timeline)
if numEvents > 0:
# status = self.parse_order_status(self.safe_string(timeline[numEvents - 1], 'action'))
timelineEventsGroupedByAction = self.group_by(timeline, 'action')
if 'error' in timelineEventsGroupedByAction:
status = 'failed'
if 'placed' in timelineEventsGroupedByAction:
placeEvents = self.safe_value(timelineEventsGroupedByAction, 'placed')
if amount is None:
Expand All @@ -928,7 +932,6 @@ def parse_order(self, order, market=None):
if 'filled' in timelineEventsGroupedByAction:
timestamp = self.safe_integer(timelineEventsGroupedByAction['filled'][0], 'timestamp')
timestamp = timestamp * 1000 if (timestamp is not None) else timestamp
type = 'market'
if 'filled' in timelineEventsGroupedByAction:
fillEvents = self.safe_value(timelineEventsGroupedByAction, 'filled')
numFillEvents = len(fillEvents)
Expand Down Expand Up @@ -971,13 +974,13 @@ def parse_order(self, order, market=None):
'сost': self.fromWei(feeCost, 'ether', feeDecimals),
'сurrency': feeCurrency,
}
status = None
amountPrecision = market['precision']['amount'] if market else 8
if remaining is not None:
status = 'open'
rest = remaining - failedAmount - deadAmount - prunedAmount
if rest < math.pow(10, -amountPrecision):
status = 'canceled' if (filled < amount) else 'closed'
if status is None:
status = 'open'
rest = remaining - failedAmount - deadAmount - prunedAmount
if rest < math.pow(10, -amountPrecision):
status = 'canceled' if (filled < amount) else 'closed'
result = {
'info': order,
'id': id,
Expand Down

0 comments on commit c26a28a

Please sign in to comment.