bittensor.core.extrinsics.asyncex.move_stake#

Functions#

move_stake_extrinsic(subtensor, wallet, origin_hotkey, ...)

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_hotkey, origin_netuid, destination_hotkey, destination_netuid, amount, wait_for_inclusion=True, wait_for_finalization=False, period=None)[source]#

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

Parameters:
  • subtensor (Subtensor) – The subtensor instance to interact with the blockchain.

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

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

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

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

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

  • amount (Balance) – The amount of stake to move as a Balance object.

  • wait_for_inclusion (bool) – If True, waits for transaction inclusion in a block. Defaults to True.

  • wait_for_finalization (bool) – If True, waits for transaction finalization. Defaults to False.

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

True if the move was successful, False otherwise.

Return type:

bool

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

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

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

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

  • 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 (Balance) – The amount of stake to swap as a Balance object.

  • wait_for_inclusion (bool) – If True, waits for transaction inclusion in a block. Defaults to True.

  • wait_for_finalization (bool) – If True, waits for transaction finalization. Defaults to False.

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

Returns:

True if the swap was successful, False otherwise.

Return type:

bool

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

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

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

  • 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 (Balance) – The amount of stake to transfer as a Balance object.

  • wait_for_inclusion (bool) – If True, waits for transaction inclusion in a block. Defaults to True.

  • wait_for_finalization (bool) – If True, waits for transaction finalization. Defaults to False.

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

True if the transfer was successful, False otherwise.

Return type:

bool