mchardysam / python-binance-chain

Binance Chain Exchange API python implementation for automated trading
http://python-binance-chain.rtfd.io
MIT License
303 stars 132 forks source link

APIError(code=401):signature verification failed #15

Closed wxy122221 closed 5 years ago

wxy122221 commented 5 years ago
  1. secp256k1 precompiled binary wheels is available for Python 2.7, 3.3, 3.4, and 3.5.
    No 3.6, I tried many ways to setup secp256k1 for 3.6, but no way. So I used 3.5

  2. I changed some f''string to .format() for python-binance-chain in Python 3.5

Then I put a Limit Order Buy as follows: limit_order_msg = LimitOrderBuyMsg( wallet=wallet, symbol='ONE-5F9_BNB', price=0.000396000, quantity=20 ) res = client.broadcast_msg(limit_order_msg, sync=True) print(res)

the result is: Traceback (most recent call last): File "/Users/sayid/PycharmProjects/coin/DEX1.2_ONE_acc.py", line 104, in res = client.broadcast_msg(limit_order_msg, sync=True) File "/anaconda3/envs/python35/lib/python3.5/site-packages/binance_chain/http.py", line 379, in broadcast_msg res = self._post(req_path, data=data) File "/anaconda3/envs/python35/lib/python3.5/site-packages/binance_chain/http.py", line 132, in _post return self._request('post', path, **kwargs) File "/anaconda3/envs/python35/lib/python3.5/site-packages/binance_chain/http.py", line 100, in _request return self._handle_response(response) File "/anaconda3/envs/python35/lib/python3.5/site-packages/binance_chain/http.py", line 110, in _handle_response raise BinanceChainAPIException(response, response.status_code) binance_chain.exceptions.BinanceChainAPIException: APIError(code=401):signature verification failed

Is the python3.5 problem? or the signature verification problem?
Thanks a lot!

moonorblue commented 5 years ago

same here with "signature verification failed", not sure how this happened, but it turns ok after i restart the script

wxy122221 commented 5 years ago

same here with "signature verification failed", not sure how this happened, but it turns ok after i restart the script

I restarted many times, but it is not working. Which version is your python? 3.5 or 3.6

moonorblue commented 5 years ago

3.5

3.7.3

wxy122221 commented 5 years ago

@moonorblue I can't setup secp256k1 for python 3.7 either window or OS. How did you solve it? Thanks a lot!

moonorblue commented 5 years ago

@moonorblue I can't setup secp256k1 for python 3.7 either window or OS. How did you solve it? Thanks a lot!

@wxy122221 I work on linux So in my case, i need to install several additional packages, like sudo apt-get install pkg-config sudo apt-get install autoconf sudo apt-get install libtool or either you can post the message you got when installing secp256k1 with python3.7 ?

wxy122221 commented 5 years ago

@moonorblue Thanks a lot!
I tried many ways to install these packages On OS:

  1. automake
  2. pkg-config
  3. libtool
  4. libffi
  5. gmp Finally it worked. I can install secp256k1 with python3.6 and 3.7 If one of them packages isn't OK, the secp256k1 can't install. Then I install python-binance-chain. It worked with python3.6. but not with 3.7 the error message is as follows:

spyder 3.3.2 requires pyqt5<5.10; python_version >= "3", which is not installed. two1 3.10.9 has requirement base58==0.2.2, but you'll have base58 1.0.3 which is incompatible. two1 3.10.9 has requirement mnemonic==0.13, but you'll have mnemonic 0.18 which is incompatible. two1 3.10.9 has requirement protobuf==3.0.0a3, but you'll have protobuf 3.8.0 which is incompatible. two1 3.10.9 has requirement requests<=2.11.1, but you'll have requests 2.21.0 which is incompatible.

wxy122221 commented 5 years ago

This error is because the python version with 3.5. When I installed secp256k1 and python-binance-chain with python 3.6 successfully. it worked.

moonorblue commented 5 years ago

happy trading :)