bittensor.core.extrinsics.staking#

Functions#

add_stake_extrinsic(subtensor, wallet[, hotkey_ss58, ...])

Adds the specified amount of stake to passed hotkey uid.

add_stake_multiple_extrinsic(subtensor, wallet, ...[, ...])

Adds stake to each hotkey_ss58 in the list, using each amount, from a common coldkey.

Module Contents#

bittensor.core.extrinsics.staking.add_stake_extrinsic(subtensor, wallet, hotkey_ss58=None, netuid=None, amount=None, wait_for_inclusion=True, wait_for_finalization=False)#

Adds the specified amount of stake to passed hotkey uid.

Parameters:
  • subtensor (bittensor.core.subtensor.Subtensor) – the Subtensor object to use

  • wallet (bittensor_wallet.Wallet) – Bittensor wallet object.

  • hotkey_ss58 (Optional[str]) – The ss58 address of the hotkey account to stake to defaults to the wallet’s hotkey.

  • netuid (Optional[int]) – Subnet unique ID.

  • amount (Optional[bittensor.utils.balance.Balance]) – Amount to stake as Bittensor balance, None if staking all.

  • wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning True, or returns False if the extrinsic fails to enter the block within the timeout.

  • wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning True, or returns False if the extrinsic fails to be finalized within the timeout.

Returns:

Flag is True if extrinsic was finalized or included in the block. If we did not wait for

finalization/inclusion, the response is True.

Return type:

success

bittensor.core.extrinsics.staking.add_stake_multiple_extrinsic(subtensor, wallet, hotkey_ss58s, netuids, amounts=None, wait_for_inclusion=True, wait_for_finalization=False)#

Adds stake to each hotkey_ss58 in the list, using each amount, from a common coldkey.

Parameters:
  • subtensor (bittensor.core.subtensor.Subtensor) – The initialized SubtensorInterface object.

  • wallet (bittensor_wallet.Wallet) – Bittensor wallet object for the coldkey.

  • hotkey_ss58s (list[str]) – List of hotkeys to stake to.

  • amounts (Optional[list[bittensor.utils.balance.Balance]]) – List of amounts to stake. If None, stake all to the first hotkey.

  • wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning True, or returns False if the extrinsic fails to enter the block within the timeout.

  • wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning True, or returns False if the extrinsic fails to be finalized within the timeout.

  • netuids (list[int])

Returns:

True if extrinsic was finalized or included in the block. True if any wallet was staked. If we did

not wait for finalization/inclusion, the response is True.

Return type:

success