-
Notifications
You must be signed in to change notification settings - Fork 511
Implemented fix for timestamps. #1
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
Conversation
… in UTC format, this prevents issues where the new Date() command generates a timestamp based on the system timezone which can cause Binance to reject any and all calls.
Test coverage went down a bit because I didn't have time to work on the test cases. I'm using this plugin in my electron app, the electron app runs on my desktop which causes an issue as the current implementation uses "new Date()" which gets the date/time based on the timezone of the current system. This is causing a difference between the timestamp generated on my end and the timestamp generated on Binance server greater than 1000ms. The Binance server rejects any requests where the difference between timestamps is greater than 1000ms. The fix I have implement will ensure that the UTC time is used regardless of the system timezone settings. |
Heyo! First off I'm using I wouldn't call -27% a little, but I think that's due to Travis not exposing the secrets to PRs, so most likely a false-positive. |
Hey man, apologies, you are using This issue is very strange, I know that the documentation says that I ended up creating a small function last night to determine the difference between local time and time of the server. Last night I was getting consistently getting differences of around 1200ms, which was causing the request to be rejected by the binance server. The first thing I checked last night was my system time, however it is syncing from the internet. I forced a resync from the internet anyway with no change in behaviour. I've run the same script this morning 8:38am (+9:30GMT) and now I'm getting a difference of around 600ms which under the 1000ms threshold so its all working fine... So I am kind of at a loss here. I'll be checking again after 11pm tonight to see if I'm going crazy or not. Otherwise I apologise for wasting your time haha. |
Haha that's okay, yeah I think that's mostly due to a time difference, and not actually the format of the timestamp being sent. I got this error too at some point, reloaded my timezone and it seemed to fix the issue. It might also come from them, you never know. But if you're experiencing too many of these issues, you should use the |
I did set the It is strange that the change I implemented fixed my issue last night, when really it shouldn't be any different from calling I'll test it again tonight anyway because I feel like I'm going crazy now. |
Hahaha, just to confirm you should look at the payload that is sent and make sure the param is sent, maybe I'm not setting it correctly? I haven't done any check on this to be honest. Otherwise the issue relies elsewhere. |
You tried the |
Implemented fix for timestamps. Ensures that timestamps are generated in UTC format, this prevents issues where the new Date() command generates a timestamp based on the system timezone which can cause Binance to reject any and all calls.