bittensor.core.extrinsics.asyncex.unstaking#
Functions#
|
Removes stake into the wallet coldkey from the specified hotkey |
|
Removes stake from each |
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, safe_staking=False, allow_partial_stake=False, rate_tolerance=0.005, period=None)[source]#
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 returnsFalse
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 returnsFalse
if the extrinsic fails to be finalized within the timeout.safe_staking (bool) – If true, enables price safety checks
allow_partial_stake (bool) – If true, allows partial unstaking if price tolerance exceeded
rate_tolerance (float) – Maximum allowed price decrease percentage (0.005 = 0.5%)
period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.
- 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
.
- Flag is
- 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, period=None)[source]#
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 returnsFalse
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 returnsFalse
if the extrinsic fails to be finalized within the timeout.period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.
- Returns:
- Flag is
True
if extrinsic was finalized or included in the block. Flag isTrue
if any wallet was unstaked. If we did not wait for finalization / inclusion, the response is
True
.
- Flag is
- Return type:
success (bool)