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

Fix for INVALID_SIGNATURE in python3.x.x #158

Merged
merged 1 commit into from
Dec 12, 2018

Conversation

forgetso
Copy link
Contributor

This is related to the following issue #136

@bitphage
Copy link

Thanks, @ericsomdahl are you maintaining the project?

@ericsomdahl
Copy link
Owner

@bitfag still here -- just slow to get around at the holiday season. I am ok with this fix but the build is broken due to the new USD markets added recently.

I can get to the fix for the build once my holiday starts, in a few days. in the meantime I will merge this knowing that the pypy build will not propagate out.

Copy link
Owner

@ericsomdahl ericsomdahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ericsomdahl ericsomdahl merged commit 2dbc08e into ericsomdahl:master Dec 12, 2018
@brotolisk
Copy link

brotolisk commented Dec 30, 2018

I'm still getting the INVALID_SIGNATURE with API 2.0 even with @forgetso 's fix in the latest version of python-bittrex.

Am I doing something wrong?

It seems like the issue is that I'm using windows. Works fine on linux

@forgetso
Copy link
Contributor Author

forgetso commented Jan 3, 2019

@brotolisk Unfortunately, I don't have windows to check this out but glad you figured it out.

@Ben0n
Copy link

Ben0n commented Jan 8, 2019

Hi, thank you guys a lot for keeping this repo up to date!!
Unfortunately I am still getting the INVALID_SIGNATURE with API 2.0.
Even with the latest fix and on Python 3.6 and 2.7.
I use a brand new API-key & secret with all permissions.
My test code would look like this:


from bittrex.bittrex import Bittrex, API_V2_0
my_bittrex = Bittrex('<MY API KEY>', '<MY SECRET>', api_version=API_V2_0) 
result = my_bittrex.trade_sell('BTC-ADX', 'LIMIT', 50.0, 0.001, 'GOOD_TIL_CANCELLED', 'NONE', 0)
print(result)

My OS is Ubuntu 18.04
Am I doing something wrong and is the fix still working for you guys?

@bitphage
Copy link

bitphage commented Jan 8, 2019

@Ben0n I have no problems on API v1.1

@Ben0n
Copy link

Ben0n commented Jan 8, 2019

@bitfag thanks for your reply! API v1.1 is working fine for me too, but since I want to place a stop-loss order via the API I would need to use the API v2.0
Is API v2.0 working for you too?

@bitphage
Copy link

bitphage commented Jan 8, 2019

@Ben0n can't say anything about 2.0, I'm sticking to v1.1 as officially supported.

@forgetso
Copy link
Contributor Author

forgetso commented Jan 9, 2019

@Ben0n Try using

my_bittrex.buy_limit(market=self.trade_pair, quantity=volume, rate=price)

but the equivalent for sell which is .sell_limit.

@forgetso
Copy link
Contributor Author

forgetso commented Jan 9, 2019

@ericsomdahl @Ben0n Sincere apologies, it seems like I had falsely attributed the disappearance of INVALID_SIGNATURE in the response to my change to python-bittrex. However, it seems that buy_limit works in python3 but trade_buy does not.

@ericsomdahl you may wish to revert this change as it effectively does nothing.

>>> hmac.new(bytearray('123','ascii'),bytearray('123','ascii'), hashlib.sha512).hexdigest() '0634fd04380bbaf5069c8c46a74c7d21df7414888d980c27a16d5e262cb8c9059139c212d0926000faf026e483904cefae2f5e9d9bd5f51fbc2ac4c4de518115'
>>> hmac.new('123'.encode(),'123'.encode(), hashlib.sha512).hexdigest() '0634fd04380bbaf5069c8c46a74c7d21df7414888d980c27a16d5e262cb8c9059139c212d0926000faf026e483904cefae2f5e9d9bd5f51fbc2ac4c4de518115'

@CarstenRuetz
Copy link

CarstenRuetz commented Jan 9, 2019

I have the same problem here. Want to use API 2.0 but I keep getting INVALID_SIGNATURE errors.

My setup:

python --version # Python 2.7.10
pip show requests # Version: 2.21.0
pip show certifi # Version: 2018.11.29
pip show idna # Version: 2.8
pip show urllib3 # Version: 1.24.1
pip show python-bittrex # Version: 0.3.0

Testing with python3 (Python 3.7.0) shows no difference (the packages are of the same versions).

I also tried different python versions using docker images - to no avail.
Also tried older versions of the above packages, no change.

Is there anyone for whom API 2.0 calls still work?
Could you maybe post your output of above versions just to rule out version problems?

Or any other ideas why API 2.0 does not work?

my test code:

from bittrex.bittrex import Bittrex, API_V2_0

my_bittrex = Bittrex('apikey','secret', api_version=API_V2_0)  # or defaulting to v1.1 as Bittrex(None, None)
print(my_bittrex.get_order_history('BTC-ETH'))
print(my_bittrex.trade_sell('BTC-ETH', 'LIMIT', 0.0001, 0.00001, 'IMMEDIATE_OR_CANCEL', 'NONE', 1.0))

JSRossiter added a commit to JSRossiter/python-bittrex that referenced this pull request Jan 31, 2019
Fix for INVALID_SIGNATURE in python3.x.x (ericsomdahl#158)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants