I'm the js SDK for SPL token there is a method called getMint which retrieves information about a mint. Which can be further used to extract decimals, supply, metadata etc. How can do this using sonala-py?
Edit: I hacked a way to do this but it's quite complicated
from spl.token._layouts import MINT_LAYOUT
from solana.rpc.api import Client, Pubkey
http_client = Client("https://api.mainnet-beta.solana.com")
addr = Pubkey.from_string("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
info = http_client.get_account_info(addr)
decimals = MINT_LAYOUT.parse(info.value.data).decimals
print(decimals)
I'm the js SDK for SPL token there is a method called
getMint
which retrieves information about a mint. Which can be further used to extract decimals, supply, metadata etc. How can do this usingsonala-py
?Edit: I hacked a way to do this but it's quite complicated