0

I am trying to check my Spot account balance using the Kucoin API, get_accounts().(Github: Link) And although on github and API documentation get_accounts specifies 2 optional arguments, when I pass any args I get an error. (client.get_accounts(currency='USDT') does not work either)

Am I doing something wrong? / Is there a better way to check my spot wallet balance for a specific coin?

from kucoin.client import Client
import config_ku

client = Client(config_ku.API_KEY, config_ku.API_SECRET, config_ku.API_PASSPHRASE)
results = client.get_accounts('USDT')
print(results) 

Error:

Traceback (most recent call last):
  File "c:\Users\Ajitesh Singh Thakur\Documents\Visual Studio Code\kucoin\test2.py", line 5, in <module>       
    results = client.get_accounts('USDT')
TypeError: get_accounts() takes 1 positional argument but 2 were given
  • Try passing the parameters by keyword: `client.get_accounts(currency='USDT')` – rdas Nov 05 '21 at 20:24
  • always put full error message (starting at word "Traceback") in question (not comment) as text (not screenshot, not link to external portal). There are other useful information. – furas Nov 05 '21 at 23:26
  • Thanks both, updated the question. And giving the keyword argument does not work either – Ajitesh Singh Thakur Nov 06 '21 at 07:21
  • code works correctly for me - but I see you created folder `kucoin` so maybe it imports code from your files in folder `kucoin` instead of import original module `kucoin`. maybe rename folder. – furas Nov 06 '21 at 09:06
  • Interesting, I tested it on an AWS instance and it works, but not on my computer. I also changed the folder name like you said and also re-installed the kucoin python package. ```Traceback (most recent call last): File "c:\Users\Ajitesh Singh Thakur\Documents\Visual Studio Code\exchanges11\test2.py", line 5, in results = client.get_accounts('VET','trade') TypeError: get_accounts() takes 1 positional argument but 3 were given``` – Ajitesh Singh Thakur Nov 06 '21 at 16:16

1 Answers1

0

I uninstalled the package and installed it again and now it works. Thanks all.