ccxt: UPBIT: Cannot cancel open order using ccxt API
- OS: Windows 10 Enterprise LTSC v. 1809
- Programming Language version: Javascript
- CCXT version: 1.19.94
- Exchange: UPBIT
- Method: exchange.fetchOpenOrders(<market>)
Good afternoon, I’m trying to cancel an order on Upbit exchange using ccxt, but I’m getting the following error:
Request: DELETE "https://sg-api.upbit.com/v1/order" {'Authorization': 'Bearer <authorization token>'} body: "{"uuid":"3efae1ab-583a-4b2a-aea9-9783ada85aad"}"
Response: "{"error":{"name":"V1::Exceptions::InvalidQueryPayload","message":"Failed to verify the query of Jwt.","dialog":"client"}}"
My guess is that the API endpoint is incorrect, but so far I haven’t found a solution.
Thanks for helping me out.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (11 by maintainers)
Commits related to this issue
- upbit cancelOrder fix #6194 — committed to ccxt/ccxt by kroitor 5 years ago
- upbit cancelOrder leftover fix #6194 — committed to ccxt/ccxt by kroitor 5 years ago
- upbit POST vs DELETE fix #6194 — committed to ccxt/ccxt by kroitor 5 years ago
- upbit minor edits #6194 — committed to ccxt/ccxt by kroitor 5 years ago
- upbit new beta signing #6194 — committed to ccxt/ccxt by kroitor 5 years ago
@coinaisseur thx for your help debugging it, appreciate your involvement!
Hi @kroitor
Thanks for the latest update. Now the fetchOpenOrders and cancelOrder functions work as expected.
Thanks again for all your help and time spent fixing this issue.
Hi @kroitor
I managed to solve my problem by changin a little bit the sign function in the upbit library. Instead of sending query in plain text, I changed the code to send its hashed form instead:
This is not the most elegant solution, but it works for me for the time being.
Thanks for your help.
Hi @kroitor
I’ve tried again to cancel order after updating ccxt, still to no avail. Here’s the verbose:
For some reason, there’s a problem with the JSON construct ccxt is sending to the exchange. In the case of fetchOpenOrders, I managed to make it work by changing hostname to ccxsg.upbit.com/api. This didn’t work with cancelOrder though.
I also tested this script on a fresh new Windows server install with latest node.js version (12.13.1) and with latest libraries installed, but it didn’t work.
Thanks for your help.