BTCMarkets / API

API
120 stars 30 forks source link

binascii.Error: Invalid base64-encoded string: number of data characters (17) cannot be 1 more than a multiple of #187

Open Ruby-Coleman opened 4 years ago

Ruby-Coleman commented 4 years ago

So I downloaded the module at https://github.com/BTCMarkets/api-v3-client-python and I placed main.py inside of the Lib folder, but whenever I try 'import main' in the python interpreter, I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\main.py", line 97, in <module>
    client = BTCMarkets(api_key, private_key)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\main.py", line 72, in __init__
    self.privateKey = base64.b64decode(privateKey)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Invalid base64-encoded string: number of data characters (17) cannot be 1 more than a multiple of 4
martin-nginio commented 4 years ago

Hi @Ruby-Coleman

Thanks for your feedback.

This demo app has been tested with Python 3.5.2 and it should work works after adding your API key and private key in the code (near the end of the file).

If it does not work with newer versions of Python3, please let us know and we will upgrade the sample.

Thanks.

Regards, Martin

prashantidealittechno commented 2 years ago

No it is not working I am getting the same error.

binascii.Error: Invalid base64-encoded string: number of data characters (117) cannot be 1 more than a multiple of 4