The following code will return the balance for a few random accounts? How would I pass in a specific account that I am interested in?
url = 'wss://karura.polkawallet.io'
substrate = SubstrateInterface(url)
hash = substrate.get_chain_finalised_head()
result = substrate.query_map('System', 'Account', block_hash = hash, max_results=2)
for account, account_info in result:
print(f"Free balance of account '{account.value}': {account_info.value['data']['free']}")
The docs mention that you can pass a list in the params argument, but I tried various ways to pass in a list and I can't get it to work. Here is one way I tried:
result = substrate.query_map('System', 'Account', params = ["account=qhYSTHXnF19w3ahxdyxWbrz4kuRm5R5S61RbzFed5LATc86"], block_hash = hash, max_results=2)