You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been receiving this error:
balance 400 Bad Request {"code":-1100,"msg":"Illegal characters found in parameter 'timestamp'; legal range is '^[0-9]{1,20}$'."}
Looking through node-binance-api I see there is an unhanded situation with timestamp storage:
publicRequest( base + 'v3/time', {}, function ( error, response ) { Binance.info.timeOffset = response.serverTime - new Date().getTime(); //Binance.options.log("server time set: ", response.serverTime, Binance.info.timeOffset); callback( error, response ); } );
Both places where timeOffset are set do not consider the possibility that there could be an error in the response and response.serverTime could be invalid. This then causes a cascade of errors with every call that uses timeOffset until it's fetched again.
Activity
jaggedsoft commentedon Aug 6, 2020
sounds like a job for !isNaN or parseInt, thanks for your report
MegaManSE commentedon Aug 6, 2020
No problem, thanks for creating this package!