cancelOrder has null callback data
Is there something off with the cancelOrder function? Doesn't seem right that the cancelOrder request from an authorized client returns a null message in its data. Shouldn't there be something similar to an order submission or a full channel message? Since GDAX doesn't let you getOrder on a cancelled order (the order ID is gone), there doesn't seem to be any options to see how much of the order was filled before it was cancelled (partial fill).
Here is some sample code. data returns null. Thanks for taking a look!
const GDAX = require('gdax');
const key = 'powerfulapikey';
const b64secret = 'secret';
const passphrase = 'supersecretpass';
const sandboxURI = 'https://api-public.sandbox.gdax.com';
const authedClient = new GDAX.AuthenticatedClient(key, b64secret, passphrase, sandboxURI);
var orderId = '5b5ed158-5432-41f5-829d-7e83dea86d98';
authedClient.cancelOrder(orderId, function(err, response, data){
if(err){
console.log("Error cancelling an order:", err);
}
else{
console.log('RESPONSE')
console.log(response);
console.log('DATA')
console.log(data);
}
});
The GDAX API has no response, so I'd argue that the wrapper library should mimic this.
You should instead subscribe to the websocket feed and listen for the canceled order message of your particular order. It will come in immediately after you issue a successful cancelOrder(). I think this is the only (correct) way to handle this without incurring any potential race conditions.
The feed message payload will look something like this:
{ type: 'done',
side: 'buy',
order_id: '21fb49a5-1216-40f5-9771-75d3a28ff097',
reason: 'canceled',
product_id: 'LTC-USD',
price: '323.23000000',
remaining_size: '0.13000000',
sequence: 847778928,
time: '2017-12-13T05:07:57.330000Z' }
I just pulled this from the public feed. You would also have extra user_id and profile_id fields if it was your personal order and you authenticated your websocket connection.
This is a bug in our API. The result is supposed to be the ID of the canceled order.
Hi, we are closing out PRs + Issues as this project is being archived.