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

restructure coach and retry to fix nonce issues #127

Merged
merged 11 commits into from
Jun 12, 2017
Merged

restructure coach and retry to fix nonce issues #127

merged 11 commits into from
Jun 12, 2017

Conversation

s4w3d0ff
Copy link
Owner

This is an attempt to fix #125 #122 and make the coach/nonces more thread friendly, more changes are needed, and this branch needs to be tested...

@s4w3d0ff s4w3d0ff added the enhancement New feature or bug fix label Jun 12, 2017
@s4w3d0ff
Copy link
Owner Author

If a nonce error occurs, the wrapper will automagicly update the nonce and try again. see #125

Python 2.7.12
[GCC 5.4.0 20160609] on linux2

>>> import poloniex
>>> import logging
>>> logging.basicConfig(level=logging.DEBUG)
>>> polo = poloniex.Poloniex('my-key', 'mysecret', timeout=None)
>>> polo._nonce = 0
>>> polo.returnBalances()['ETH']
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): poloniex.com
DEBUG:requests.packages.urllib3.connectionpool:"POST /tradingApi HTTP/1.1" 422 None
DEBUG:poloniex:{"error":"Nonce must be greater than 1496260118086481. You provided 42."}
DEBUG:poloniex:PoloniexErrorNonce must be greater than 1496260118086481. You provided 42.
INFO:poloniex:-- delaying for 0s
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): poloniex.com
DEBUG:requests.packages.urllib3.connectionpool:"POST /tradingApi HTTP/1.1" 200 None
DEBUG:poloniex:{"1CR":"0.00000000",,,}
u'0.00000000'
>>>

It should also handle/retry connection errors returned from poloniex (#122)

@s4w3d0ff s4w3d0ff merged commit 9d43d89 into master Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nonce must be greater...
1 participant