Closed capaj closed 5 months ago
It's not the SDK that decides this should be an error. That code and message style response means that the exchange responded with that error in response to your request. Definitely seems weird, if the cancel order request actually worked based on what you see on the website. I would definitely report this to binance.
And just to check a really silly question, are you absolutely certain you're not accidentally calling cancel order twice, so only the second request fails?
If you can easily reproduce this, you could try reaching out to binance in their API community on telegram - it's typically where I ask/report things that seem unclear: https://t.me/binance_api_english
As with any telegram community, don't trust anyone that messages you directly of course (since that happens a lot in these groups sadly).
And just to check a really silly question, are you absolutely certain you're not accidentally calling cancel order twice, so only the second request fails?
That was my first thought as well, sadly no😅
Will put together a tiny reproduction.
Forgot to mention I am using bun as runtime. Will try with nodejs tomorrow
actually I just tried with this code in bun
import { botSettings } from '../botSettings'
import { binanceClient } from './binanceClient'
const res = await binanceClient.cancelOrder({
symbol: botSettings.symbol,
orderId: XXXXXXX
})
console.log(res)
and it went through nicely so I suspect it was actually the duplicate call most likely or I called it after the order was filled.
Sorry for spamming
I am getting:
every time I try to cancel a valid order. Order is open in the official binance web client and after I call this it is actually cancelled. So why is that error thrown? For now I just ignore it with a try catch, but why is it even getting thrown?