Kucoin / kucoin-node-sdk

KuCoin API SDK for Node.js language.
Apache License 2.0
106 stars 53 forks source link

cancelOrderByClientOid doesn't work #17

Open mjwvb opened 3 years ago

mjwvb commented 3 years ago

I'm trying to cancel my order with the custom client order id using rest.Trade.Orders.cancelOrderByClientOid(), but it doesn't do anything.

I was looking in the code, and it seems the function arguments are incorrect:

exports.cancelOrderByClientOid = async function cancelOrderByClientOid({ symbol, tradeType } = {}) {
  return await Http().DEL(`/api/v1/order/client-order/${clientOid}`);
};

Should be something like:

exports.cancelOrderByClientOid = async function cancelOrderByClientOid(clientOid) {
  return await Http().DEL(`/api/v1/order/client-order/${clientOid}`);
};

For now I have to use the unique order id with cancelOrder() as returned by postOrder(), but it's not ideal.