bittensor.core.extrinsics.move_stake#

Functions#

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

Moves stake to a different hotkey and/or subnet while keeping the same coldkey owner.

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

Moves stake between subnets while keeping the same coldkey-hotkey pair ownership.

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

Transfers stake from one subnet to another while changing the coldkey owner.

Module Contents#

bittensor.core.extrinsics.move_stake.move_stake_extrinsic(subtensor, wallet, origin_hotkey, origin_netuid, destination_hotkey, destination_netuid, amount=None, wait_for_inclusion=True, wait_for_finalization=False, period=None)[source]#

Moves stake to a different hotkey and/or subnet while keeping the same coldkey owner.

Parameters:
  • subtensor (Subtensor) – Subtensor instance.

  • wallet (bittensor.wallet) – The wallet to move stake from.

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

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

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

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

  • amount (Union[Balance, float]) – Amount to move.

  • wait_for_inclusion (bool) – If true, waits for inclusion before returning.

  • wait_for_finalization (bool) – If true, waits for finalization before returning.

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

Return type:

success (bool)

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

Moves stake between subnets while keeping the same coldkey-hotkey pair ownership.

Parameters:
  • subtensor (Subtensor) – Subtensor instance.

  • wallet (bittensor.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 (Union[Balance, float]) – Amount to swap.

  • wait_for_inclusion (bool) – If true, waits for inclusion before returning.

  • wait_for_finalization (bool) – If true, waits for finalization before returning.

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

Return type:

success (bool)

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

Transfers stake from one subnet to another while changing the coldkey owner.

Parameters:
  • subtensor (Subtensor) – Subtensor instance.

  • wallet (bittensor.wallet) – The wallet to transfer stake from.

  • destination_coldkey_ss58 (str) – The destination coldkey SS58 address.

  • 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 (Union[Balance, float, int]) – Amount to transfer.

  • wait_for_inclusion (bool) – If true, waits for inclusion before returning.

  • wait_for_finalization (bool) – If true, waits for finalization before returning.

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

Return type:

success (bool)