bittensor.core.extrinsics.asyncex.move_stake#

Functions#

move_stake_extrinsic(subtensor, wallet, origin_netuid, ...)

Moves stake from one hotkey to another within subnets in the Bittensor network.

swap_stake_extrinsic(subtensor, wallet, hotkey_ss58, ...)

Swaps stake from one subnet to another for a given hotkey in the Bittensor network.

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

Transfers stake from one coldkey to another in the Bittensor network.

Module Contents#

async bittensor.core.extrinsics.asyncex.move_stake.move_stake_extrinsic(subtensor, wallet, origin_netuid, origin_hotkey_ss58, destination_netuid, destination_hotkey_ss58, amount=None, move_all_stake=False, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)[source]#

Moves stake from one hotkey to another within subnets in the Bittensor network.

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

  • wallet (bittensor_wallet.Wallet) – The wallet to move stake from.

  • origin_netuid (int) – The netuid of the source subnet.

  • origin_hotkey_ss58 (str) – The SS58 address of the source hotkey.

  • destination_netuid (int) – The netuid of the destination subnet.

  • destination_hotkey_ss58 (str) – The SS58 address of the destination hotkey.

  • amount (Optional[bittensor.utils.balance.Balance]) – Amount to move.

  • move_all_stake (bool) – If true, moves all stake from the source hotkey to the destination hotkey.

  • 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.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

async bittensor.core.extrinsics.asyncex.move_stake.swap_stake_extrinsic(subtensor, wallet, hotkey_ss58, origin_netuid, destination_netuid, amount, safe_swapping=False, allow_partial_stake=False, rate_tolerance=0.005, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)[source]#

Swaps stake from one subnet to another for a given hotkey in the Bittensor network.

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

  • wallet (bittensor_wallet.Wallet) – The wallet to swap stake from.

  • hotkey_ss58 (str) – The hotkey SS58 address associated with the stake.

  • origin_netuid (int) – The source subnet UID.

  • destination_netuid (int) – The destination subnet UID.

  • amount (bittensor.utils.balance.Balance) – Amount to swap.

  • safe_swapping (bool) – If true, enables price safety checks to protect against price impact.

  • allow_partial_stake (bool) – If true, allows partial stake swaps when the full amount would exceed the price tolerance.

  • rate_tolerance (float) – Maximum allowed increase in a price ratio (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.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

async bittensor.core.extrinsics.asyncex.move_stake.transfer_stake_extrinsic(subtensor, wallet, destination_coldkey_ss58, hotkey_ss58, origin_netuid, destination_netuid, amount, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True)[source]#

Transfers stake from one coldkey to another in the Bittensor network.

Parameters:
  • subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – The subtensor instance to interact with the blockchain.

  • wallet (bittensor_wallet.Wallet) – The wallet containing the coldkey to authorize the transfer.

  • destination_coldkey_ss58 (str) – SS58 address of the destination coldkey.

  • hotkey_ss58 (str) – SS58 address of the hotkey associated with the stake.

  • origin_netuid (int) – Network UID of the origin subnet.

  • destination_netuid (int) – Network UID of the destination subnet.

  • amount (bittensor.utils.balance.Balance) – The amount of stake to transfer as a Balance object.

  • 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.

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse