You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For folks who got the issue n = string[0] if isinstance(string[0], int) else ord(string[0]) IndexError: index out of range, it is because the @staticmethod def encode(string): return string.encode('latin-1') in exchange.py will only encode the part of the string before its first \n line seperater. So the first step is to remove the '\n' line seperate in your secret.
Then input your secret in the format of this:
'''-----BEGIN EC PRIVATE KEY-----
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
xxxxxxxx
-----END EC PRIVATE KEY-----'''
You don't need to change the original key or password, here's an example:
Operating System
MacOS
Programming Languages
Python
CCXT Version
4.3.5
Description
For folks who got the issue
n = string[0] if isinstance(string[0], int) else ord(string[0]) IndexError: index out of range
, it is because the@staticmethod def encode(string): return string.encode('latin-1')
in exchange.py will only encode the part of the string before its first\n
line seperater. So the first step is to remove the '\n' line seperate in your secret.Then input your secret in the format of this:
'''-----BEGIN EC PRIVATE KEY-----
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
xxxxxxxx
-----END EC PRIVATE KEY-----'''
You don't need to change the original key or password, here's an example:
exchange = ccxt.coinbase({
'apiKey': api_key,
'secret': '''-----BEGIN EC PRIVATE KEY-----
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
xxxxxxxx
-----END EC PRIVATE KEY-----''',
'password': api_passphrase,
})
Hope this issue could be solved soon, since I would not want to store my api secret in my code. Thanks
Code
The text was updated successfully, but these errors were encountered: