When querying storage functions using Polkascan's py-substrate-interface how do you figure out which parameters are required?
For example, I am trying to discern how much KSM is on Karura via storage functions in the tokens (ORML) pallet.
See below code for example. I tried to substrate.query()
Tokens.TotalIssuance storage_function but it requires 6 parameters:
from substrateinterface import SubstrateInterface
substrate = SubstrateInterface(url="wss://karura-rpc-0.aca-api.network/")
result = substrate.query(module='Tokens',storage_function='TotalIssuance')
**ValueError**: Storage function requires 6 parameters, 0 given
Note, I also tried to to use substrate.query_map()
for Token.Accounts storage function but that requires 1 parameter which I can't discern.
result = substrate.query_map(
module='Tokens',
storage_function='Accounts',
page_size=10,
max_results = 100)
**ValueError**: Storage function map requires 1 parameters, 0 given
Does anyone have any advice on how to find out which parameters are required for substrate.query()
& substrate.query_map()
? I have been digging around in the library docs along with substrate storage documentation but I can't figure it out.
Other Note: Through trial and error and comparing with Polkadot.JS queries (see screenshot) I managed to figure out that substrate.query()
Tokens.Accounts for a KSM balance of a single Karura account requires two paramaters: params = ['karura_address',{'Token':'KSM'}]
.
Thanks in advance!