sammchardy / python-idex

IDEX v3 Exchange REST API python implementation

Home Page:https://python-idex.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Order signature invalid

rfenzo opened this issue · comments

Hello, first of all, thank you for free your code. I just installed the package and tried the basic script that you post but it throws an error when trying to open an order, I'm able to get my balances so it isn't a problem with the address and private key.

It throws the error in this line:
order = client.create_order('EOS', 'ETH', '0.00110120', '154')

The exception:
Traceback (most recent call last): File "/home/rfenzo/Desktop/idextrader.py", line 17, in <module> order = client.create_order('EOS', 'ETH', '0.00110120', '154') File "/home/rfenzo/.local/lib/python3.5/site-packages/idex/client.py", line 1228, in create_order return self.create_order_wei(token_buy, token_sell, amount_buy, amount_sell) File "/home/rfenzo/.local/lib/python3.5/site-packages/idex/client.py", line 1300, in create_order_wei return self._post('order', True, hash_data=hash_data) File "/home/rfenzo/.local/lib/python3.5/site-packages/idex/client.py", line 144, in _post return self._request('post', path, signed, **kwargs) File "/home/rfenzo/.local/lib/python3.5/site-packages/idex/client.py", line 123, in _request return self._handle_response(response) File "/home/rfenzo/.local/lib/python3.5/site-packages/idex/client.py", line 135, in _handle_response raise IdexAPIException(response) idex.exceptions.IdexAPIException: IdexAPIException: Order signature invalid

@rfenzo just so you are aware, you can get the balances for any public address. get_my_balances just calls it with your own public address

True, I forgot about that. Still getting the error anyway

@rfenzo check that your address and API key are correct.

Got it working, the problem was that i was using my private key without the 0x requested.

@sammchardy I ran into this issue aswell today, might be a good idea to assert len(private_key) == 66