I need some help with solana.py API (for python). I am trying to get total supply of the token (token here) - so I copy mint address according to documentation (gettokensupply) and write usual code on solana==0.25.1:
from solana.rpc.api import Client
from solana.publickey import PublicKey
http_client_solana = Client("https://api.devnet.solana.com")
pubkey = PublicKey("CxwTQccajoiDn9Xb7BpTbvDQXEaSKNYQWMCUETiNgidZ")
response = http_client_solana.get_token_supply(pubkey)
amount = int(response["result"]['value']['amount'])
decimals = response["result"]['value']['decimals']
But I receive a response
:
{'jsonrpc': '2.0', 'error': {'code': -32602, 'message': 'Invalid param: could not find account'}, 'id': 1}
I don't understand what I am doing wrong, is it a problem on my end? I tried using it also with a coin address, but I still get the same error. I checked if I used exactly the mint and tried to call it using mentioned address in the example, but still receive the same error. I tried researching the problem, but found no hints.