-
Notifications
You must be signed in to change notification settings - Fork 70
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
Invalid nonce error #18
Comments
Hello, I just tried to test it, and account_balance() method works fine in my test script. Kamil |
Hello Once per script. The script is run once an hour. I have a separate php site that reloads my balance and current level but that is once every few hours (manual). The website uses the php lib on git. No errors there. On Wed, Jun 18, 2014 at 4:26 PM, Kamil Madac notifications@github.com
|
Also I tried modifying the nonce get to just take the unix time not the max of nonce and unix time and I get the same error regardless. — On Wed, Jun 18, 2014 at 4:26 PM, Kamil Madac notifications@github.com
|
Is time on your server set correctly? |
It has the same error on a windows 8 pc and an up to date mac. I can easily generate a new key/secret. Will check back in once I do that. Thanks. — On Wed, Jun 18, 2014 at 5:03 PM, Kamil Madac notifications@github.com
|
My guess is that you've used an nonce greater than the ones being generated
|
Hm. Interesting but unsure. Maybe there is a discrepancy between the php nonce and the up nonce. — On Wed, Jun 18, 2014 at 6:09 PM, Chris Beaven notifications@github.com
|
Er phone -> php (thx autocomplete...) |
I knew what you meant no worries. I'll get a new key and give it a whirl. I will also try to recreate the error to be sure. — On Wed, Jun 18, 2014 at 6:12 PM, Chris Beaven notifications@github.com
|
Getting a new api key fixed the problem here. I will give the php a whirl Jason Mellone On Wed, Jun 18, 2014 at 6:13 PM, Jason Mellone jason.mellone@gmail.com
|
Hello I discovered and solved the issue for my own uses. In the php api the following code is establishing the nonce: with this, I have a comparison to the python code:
""" Get a unique nonce for the bitstamp API. This integer must always be increasing, so use the current unix time. Every time this variable is requested, it automatically increments to allow for more than one API request per second. This isn't a thread-safe function however, so you should only rely on a single thread if you have a high level of concurrent API requests in your application. """ nonce = getattr(self, '_nonce', 0) if nonce: nonce += 1 If the unix time is greater though, use that instead (helps lowconcurrency multi-threaded apps always call with the largest nonce).self._nonce = max(int(time.time()), nonce) return self._nonce Which you are familiar with I am sure. The error was indeed being created by the php/python piece of my cross A VERY VERY easy solution (I implemented this locally, but I will let you self._nonce = max(int(time.time()), nonce) to self._nonce = max(int(time.time()*1000000), nonce) As your nonce is created as: 1403366728.072785 and then cast to int and the php nonce is created as: 1403366859731819 Do you think it would be best to update the python api to be in line with This is my first real interaction with a github project, so I am happy to Jason Jason Mellone On Thu, Jun 19, 2014 at 7:47 AM, Jason Mellone jason.mellone@gmail.com
|
Hi Jason, thank you for investigation and sorry for delayed response. I think that it is not bad idea to generate nonce with microsecond precision. Could you please create pull request (https://help.github.com/articles/using-pull-requests) with your code change? It is easy and you will be become contributor of the Bitstamp client;) |
Closed because no reaction for a long time. |
Hello,
I posted the question on stackoverflow, but I am getting the following error when using a valid user/key/secret.
http://stackoverflow.com/questions/24285109/python-bitstamp-api-invalid-nonce-error
Unsure what I can do to solve this or what I have done wrong. Please let me know if this is a bug or not as I would love to get it solved. Happy to contribute in modifying the code, but unsure why this is occurring.
This login was working up until it sporadically stopped working yesterday evening.
The text was updated successfully, but these errors were encountered: