bittensor.core.extrinsics.asyncex.unstaking

bittensor.core.extrinsics.asyncex.unstaking#

Functions#

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

Removes stake into the wallet coldkey from the specified hotkey uid.

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

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

Module Contents#

async bittensor.core.extrinsics.asyncex.unstaking.unstake_extrinsic(subtensor, wallet, hotkey_ss58=None, netuid=None, amount=None, wait_for_inclusion=True, wait_for_finalization=False)#

Removes stake into the wallet coldkey from the specified hotkey uid.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – AsyncSubtensor instance.

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

  • hotkey_ss58 (Optional[str]) – The ss58 address of the hotkey to unstake from. By default, the wallet hotkey is used.

  • netuid (Optional[int]) – The subnet uid to unstake from.

  • amount (Union[Balance, float]) – Amount to stake as Bittensor balance, or float interpreted as Tao.

  • 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 (bool)

async bittensor.core.extrinsics.asyncex.unstaking.unstake_multiple_extrinsic(subtensor, wallet, hotkey_ss58s, netuids, amounts=None, wait_for_inclusion=True, wait_for_finalization=False)#

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

Parameters:
  • subtensor (bittensor.core.subtensor.Subtensor) – Subtensor instance.

  • wallet (bittensor_wallet.Wallet) – The wallet with the coldkey to unstake to.

  • hotkey_ss58s (List[str]) – List of hotkeys to unstake from.

  • netuids (List[int]) – List of netuids to unstake from.

  • amounts (List[Union[Balance, float]]) – List of amounts to unstake. If None, unstake 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. Flag is True if any

wallet was unstaked. If we did not wait for finalization / inclusion, the response is True.

Return type:

success (bool)