Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Update Luno #2417

Merged
merged 21 commits into from
Aug 10, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
  • Loading branch information
hiyan committed Aug 8, 2018
commit 28735e0fb0f396d0a44e42caf36159db289ab904
4 changes: 4 additions & 0 deletions exchange/wrappers/luno.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,18 @@ Trader.prototype.cancelOrder = function(order, callback) {
return callback(err);
}
}

if (data && !data.success) {
log('cancelOrder() --> status:', data.success);
return callback(undefined, false);
}

this.checkOrder(order, (error, orderStatus) => {
if (error) {
log(name, 'cancelOrder\'s checkOrder failed. What do i do here?');
Copy link
Owner

Choose a reason for hiding this comment

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

Good question.. At that point we are sure that the order was cancelled but we do not have fill information. Let's keep it like this: we bubble up the error and have Gekko figure out how to proceed.

Assuming it was or was not partially filled will probably lead to nasty bugs down the line.

return callback(error, false);
}

if (orderStatus.executed) {
log(name, 'cancelOrder() -->', order, 'was fulfilled before cancelOrder was completed.');
return callback(undefined, true);
Expand Down Expand Up @@ -381,6 +384,7 @@ Trader.prototype.getTrades = function(since, callback, descending) {
pair: this.pair,
since: since
}

const handler = cb => this.luno.getTrades(options, processResponse('getTrades', cb));
retry(null, handler, process);
}
Expand Down