michaelhly / solana-py

Solana Python SDK
https://michaelhly.github.io/solana-py
MIT License
979 stars 252 forks source link

message: "Invalid param: not a Token account" #427

Open amazzuca opened 4 months ago

amazzuca commented 4 months ago

Hello. I'm trying to get the amount of x token on my wallet, but when I type the following :

`from solana.rpc.api import Client, Pubkey

http_client = Client("https://api.mainnet-beta.solana.com")

token_accounts = http_client.get_token_account_balance( Pubkey.from_string("8z94RRiZg4KqtFu36spCpwt7hTtm1pRpmX9YHY5xD86m") ) print(token_accounts)`

I get the following:

InvalidParamsMessage { message: "Invalid param: not a Token account" }

How can I get the correct Token account?