I'm making API Calls on Threads. The API requires each call to have Nonce greater then the last call.
I'm generating Nonce using this code:
req['nonce'] = int(time.time()*1000000)
I'm getting errors:
"{u'error': u'Nonce must be greater than 1427495062551856. You provided 1427495062544266.'}".
I believe the cause of the error is slight variations in API request/response times is causing one API request to reach the server ahead of a prior request (that would have a lower Nonce).
Does anyone have a solution for this?
I had that problem when using Poloniex crypto currency exchange API. Some buy or sell calls were hanging for 2 minutes for some reason (you probably could ask Poloniex why it's like that). My calls were asynchronous, so new calls were made without waiting for "hung" calls.
I just re-made these hung calls checking for a "Nonce must be greater than " prefix on error string. You can see the code in my github repo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With