Closed tazengineering closed 1 week ago
Hello @tazengineering, cloud keys support was introduced recently, so you need to update your ccxt version to get it
Hi @carlosmiei
I have updated to ccxt-4.2.100 and the issue persists.
@tazengineering Can you please double-check your api keys/permissions/ip restrictions/etc? I'm using it right now and seems to be working
@carlosmiei
Thank you for taking the time to support me.
Are you using the same format for API key and secret I shared?
I removed completely any IP restrictions.
Where do you setup permissions from?
Regards Ciprian
@tazengineering I'm using the keys from the file coinbase provides upon creating the keys
And I'm creating them here: https://portal.cloud.coinbase.com/access/api?keyType=trade&referrer=advanced_trade
Guys, sorry, must the secret key set as parameter "as is"? I'm getting in PHP (version 4.2.100) in BigInteger.php error, because secret key transmitted to it as is - with "BEGIN PRIVATE KEY" etc.
@KRV1 Are you reading the keys from a file? Can you check if the \n are properly escaped?
@KRV1 Can you try to parse your secret doing this?
$private_key = str_replace('\n', "\n", $private_key);
@carlosmiei Thank you, yes problem was in the carriage return symbol Seems it works now
Thank you @carlosmiei
Unfortunately I could not manage to make it work in Python.
I see you have yours using .json and split into multiple keys - where I only have 'apiKey' and 'secret' key.
exchange = ccxt.coinbase({
'apiKey': "organizations/XXXXXXXXXXXXXXXXXXXX/apiKeys/XXXXXXXXXXXXXXXXXXXXXXXXXX",
'secret': "-----BEGIN EC PRIVATE KEY-----\nXXXXXXXXXXXXX==XXXXXXXXXXXXXXXXXXX==XXXXX\nXXXXXXXXXXXXXXXXXXXXXXX==XXXXXXXXXXXXXX\nXXXXXXXXX==XXXXXXXXXX==XXXXXXXXXXXXXXXX==XXXXXXXXXX==\n-----END EC PRIVATE KEY-----\n",
})
issue is persisting for me
I am having the same issue as well. There doesn't seem to be anything conclusive anywhere I've looked. This seems to be a CB issue because there are many questions about it
I thought this was a CB issue as well so I decided to try using the CB advanced trade SDK. It works perfectly so I'm no longer using ccxt, hopefully this gets fixed.
@reverendrenegade @bradym05 This is tricky because as I said locally things work as expected for us. What's your ccxt and python version?
@bradym05 @bradym05 I can try to ask coinbase directly about your specific issue, can you share your accountId/email via pm in discord/telegram?
@carlosmiei @bradym05
Thanks for the reply!
ccxt Version: 4.3.18 Python Version: 3.11.2 (main, May 8 2024, 11:29:38) [GCC 9.4.0]
After updating to the latest version of ccxt and Python this solved the issue. Thanks for everyone's time.
@reverendrenegade Great, thanks for letting us know!
Upgraded to 4.3.27 to use the Coinbase CDP API keys, now am getting these errors in all python scripts on any API call. No other changes were made. Is there some parameter that I need to pass to get backward compatibility??
CCXT Version: 4.3.27 index out of range
EDIT: Figured out that I needed to convert the \n chars in the private key into actual newline in python code.
private_key = src_private_key.replace('\\n', '\n').replace('\\t', '\t')
That resolved it.
CCXT Version: 4.3.29 Python: 3.12.3
I tried the following, but I still get the issue: IndexError: index out of range
config['coinbase_secret'].replace('\n', "\n")
and
config['coinbase_secret'].replace('\n', "\n").replace('\t', '\t')
Can someone help me?
I use this structure, with a .env file:
exchange = ccxt.coinbase({
'apiKey': "organizations/XXXXXXXXXXXXXXXXXXXX/apiKeys/XXXXXXXXXXXXXXXXXXXXXXXXXX",
'secret': "-----BEGIN EC PRIVATE KEY-----\nXXXXXXXXXXXXX==XXXXXXXXXXXXXXXXXXX==XXXXX\nXXXXXXXXXXXXXXXXXXXXXXX==XXXXXXXXXXXXXX\nXXXXXXXXX==XXXXXXXXXX==XXXXXXXXXXXXXXXX==XXXXXXXXXX==\n-----END EC PRIVATE KEY-----\n",
})
You’ll need 2 backslashes in the first parameter replace() method.
config['coinbase_secret'].replace(‘\n', "\n")
and
config['coinbase_secret'].replace(‘\n', "\n").replace(‘\t', '\t')
Awesome, thanks for your fast support!
Awesome, thanks for your fast support!
I happen to be in the middle of fixing my scripts for Coinbase CDP and ccxt upgrades ... hope this helps you out.
@jtashiro Thanks for the help! 🙂
as there remains no users in this thread (who experiences issues) i'll close this topic. feel free to contact back again if any issue
Operating System
Windows
Programming Languages
Python
CCXT Version
4.2.64
Description
Issue when attempting to connect to Coinbase Advanced Trade.
Error: AuthenticationError: coinbase GET https://api.coinbase.com/api/v3/brokerage/products 401 Unauthorized Unauthorized
I have tried with both apiKey and Secret simplified or the full text shown when generating the API.
Code