Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Order Future is not returning the right order id #560

Open
camel113 opened this issue Apr 5, 2022 · 2 comments
Open

Get Order Future is not returning the right order id #560

camel113 opened this issue Apr 5, 2022 · 2 comments

Comments

@camel113
Copy link

camel113 commented Apr 5, 2022

binanceClient.futuresGetOrder is not returning the right id
Some orders have big integer as id like 4676302302390926857 for HNTUSDT
When executing

const order = await binanceClient.futuresGetOrder({
  symbol:"HNTUSDT",
  orderId: 4676302302390926857,
});

api is returning me the correct order but with the wrong id

{
  orderId: 4676302302390927000,
  symbol: 'HNTUSDT',
  status: 'FILLED',
  ...
}

Looks like it is not handling big integer. Had someone already have this issue?

@JonathanLoscalzo
Copy link
Contributor

@camel113 perhaps binance is not able to manage that orderId number?
Because javascript MAX_VALUE integer is 1.7976931348623157e+308 (Number.MAX_VALUE), So I expected that, on binance-node-api, it works.

Do you test it out directly to binance?

@ljudbane
Copy link

Problem is in encodeURIComponent. If i test in Chrome console:

encodeURIComponent(4676302302390926857)
'4676302302390927000'

The same result is if i use parseInt() function. Some overflow happens or something. I think that orderId should be string type to avoid these problems:

encodeURIComponent("4676302302390926857")
'4676302302390926857'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants