bittensor.core.extrinsics.utils

bittensor.core.extrinsics.utils#

Module with helper functions for extrinsics.

Functions#

get_old_stakes(wallet, hotkey_ss58s, netuids, all_stakes)

Retrieve the previous staking balances for a wallet's hotkeys across given netuids.

Module Contents#

bittensor.core.extrinsics.utils.get_old_stakes(wallet, hotkey_ss58s, netuids, all_stakes)[source]#

Retrieve the previous staking balances for a wallet’s hotkeys across given netuids.

This function searches through the provided staking data to find the stake amounts for the specified hotkeys and netuids associated with the wallet’s coldkey. If no match is found for a particular hotkey and netuid combination, a default balance of zero is returned.

Parameters:
  • wallet (bittensor_wallet.Wallet) – The wallet containing the coldkey to compare with stake data.

  • hotkey_ss58s (list[str]) – List of hotkey SS58 addresses for which stakes are retrieved.

  • netuids (list[int]) – List of network unique identifiers (netuids) corresponding to the hotkeys.

  • all_stakes (list[bittensor.core.chain_data.StakeInfo]) – A collection of all staking information to search through.

Returns:

A list of Balances, each representing the stake for a given hotkey and netuid.

Return type:

list[Balance]