Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "remaining" field in gate.io order status. #3020

Merged
merged 3 commits into from
Jun 3, 2018

Conversation

miracle2k
Copy link
Contributor

Here is an example of gate.io order result I am seeing in fetchOrder:

{'amount': '0.00000000',
  'currencyPair': 'eos_usdt',
  'fee': '0 USDT',
  'feeCurrency': 'USDT',
  'feePercentage': 0.2,
  'feeValue': '0',
  'filledAmount': '0',
  'filledRate': '14.6201',
  'initialAmount': '16.68270983',
  'initialRate': '14.6201',
  'left': 16.68270983,
  'orderNumber': '837545296',
  'rate': '14.6201',
  'status': 'cancelled',
  'timestamp': 1528048660,
  'type': 'buy'}

But note the structure when submitting an order:

{'code': 0,
  'filledAmount': '0',
  'filledRate': '5',
  'initialAmount': 5,
  'leftAmount': '5.00000000',
  'message': 'Success',
  'orderNumber': 837670400,
  'rate': '5',
  'result': 'true',
  'status': 'open',
  'type': 'buy'}

It seems that in the order status, they carelessly named the field left instead of leftAmount.

Here is an example of gate.io order result I am seeing in fetchOrder:

```
{'amount': '0.00000000',
  'currencyPair': 'eos_usdt',
  'fee': '0 USDT',
  'feeCurrency': 'USDT',
  'feePercentage': 0.2,
  'feeValue': '0',
  'filledAmount': '0',
  'filledRate': '14.6201',
  'initialAmount': '16.68270983',
  'initialRate': '14.6201',
  'left': 16.68270983,
  'orderNumber': '837545296',
  'rate': '14.6201',
  'status': 'cancelled',
  'timestamp': 1528048660,
  'type': 'buy'}
```

But note the structure when submitting an order:

```
{'code': 0,
  'filledAmount': '0',
  'filledRate': '5',
  'initialAmount': 5,
  'leftAmount': '5.00000000',
  'message': 'Success',
  'orderNumber': 837670400,
  'rate': '5',
  'result': 'true',
  'status': 'open',
  'type': 'buy'}
```

It seems that in the order status, they carelessly named the field `left` instead of `leftAmount`.
js/gateio.js Outdated
@@ -365,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') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this line read like:

if (typeof remaining === 'undefined') {
   ...
}

? )

@kroitor kroitor self-assigned this Jun 3, 2018
@miracle2k
Copy link
Contributor Author

It certainly should, I wasn't careful there. Sorry about that, it's fixed now!

@kroitor kroitor merged commit d6861f9 into ccxt:master Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants