bittensor.extrinsics.unstaking#
Module Contents#
Functions#
| 
 | Executes an unstake call to the chain using the wallet and the amount specified. | 
| 
 | Removes stake into the wallet coldkey from the specified hotkey  | 
| 
 | Removes stake from each  | 
- bittensor.extrinsics.unstaking.__do_remove_stake_single(subtensor, wallet, hotkey_ss58, amount, wait_for_inclusion=True, wait_for_finalization=False)#
- Executes an unstake call to the chain using the wallet and the amount specified. - Parameters:
- wallet (bittensor.wallet) – Bittensor wallet object. 
- hotkey_ss58 (str) – Hotkey address to unstake from. 
- amount (bittensor.Balance) – Amount to unstake as Bittensor balance object. 
- wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning - true, or returns- falseif 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- falseif the extrinsic fails to be finalized within the timeout.
- prompt (bool) – If - true, the call waits for confirmation from the user before proceeding.
- subtensor (bittensor.subtensor) – 
 
- Returns:
- Flag is - trueif extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is- true.
- Return type:
- success (bool) 
- Raises:
- bittensor.errors.StakeError – If the extrinsic fails to be finalized or included in the block. 
- bittensor.errors.NotRegisteredError – If the hotkey is not registered in any subnets. 
 
 
- bittensor.extrinsics.unstaking.unstake_extrinsic(subtensor, wallet, hotkey_ss58=None, amount=None, wait_for_inclusion=True, wait_for_finalization=False, prompt=False)#
- Removes stake into the wallet coldkey from the specified hotkey - uid.- Parameters:
- wallet (bittensor.wallet) – Bittensor wallet object. 
- hotkey_ss58 (Optional[str]) – The - ss58address of the hotkey to unstake from. By default, the wallet hotkey is used.
- amount (Union[Balance, float]) – Amount to stake as Bittensor balance, or - floatinterpreted as Tao.
- wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning - true, or returns- falseif 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- falseif the extrinsic fails to be finalized within the timeout.
- prompt (bool) – If - true, the call waits for confirmation from the user before proceeding.
- subtensor (bittensor.subtensor) – 
 
- Returns:
- Flag is - trueif extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is- true.
- Return type:
- success (bool) 
 
- bittensor.extrinsics.unstaking.unstake_multiple_extrinsic(subtensor, wallet, hotkey_ss58s, amounts=None, wait_for_inclusion=True, wait_for_finalization=False, prompt=False)#
- Removes stake from each - hotkey_ss58in the list, using each amount, to a common coldkey.- Parameters:
- wallet (bittensor.wallet) – The wallet with the coldkey to unstake to. 
- hotkey_ss58s (List[str]) – List of hotkeys 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- falseif 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- falseif the extrinsic fails to be finalized within the timeout.
- prompt (bool) – If - true, the call waits for confirmation from the user before proceeding.
- subtensor (bittensor.subtensor) – 
 
- Returns:
- Flag is - trueif extrinsic was finalized or included in the block. Flag is- trueif any wallet was unstaked. If we did not wait for finalization / inclusion, the response is- true.
- Return type:
- success (bool)