Querying for Account Balance, Staked Balance, Staking Rewards #310
-
I have searched around for this. I am able to pull up "Account Balance" pretty simply. However, is there a way to also see what the current stake is and how much an account is receiving in rewards? I'm also curious if you can get historical stake balance and rewards easily? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To see the current stake, you can use the following storage functions: controller_account = substrate.query(
'Staking', 'Bonded', ['<STASH_ACCOUNT_ID>']
)
stake_info = substrate.query(
'Staking', 'Ledger', [controller_account.value]
)
print(stake_info.value) More info about Staking storage_functions: https://polkascan.github.io/py-substrate-metadata-docs/polkadot/#storage-functions_9 As for historical stake balance and rewards, that is a another combination of storage calls, you can check out https://github.com/stakelink/substrate-payctl which is a CLI to staking reward related actions |
Beta Was this translation helpful? Give feedback.
To see the current stake, you can use the following storage functions:
More info about Staking storage_functions: https://polkascan.github.io/py-substrate-metadata-docs/polkadot/#storage-functions_9
As for historical stake balance and rewards, that is a another combination of storage calls, you can check out https://github.com/stakelink/substrate-payctl which is a CLI to staking reward related actions