Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ class Options:
"--wallet.hotkey",
help="Hotkey of the wallet",
)
wallet_hotkey_ss58 = typer.Option(
None,
"--hotkey",
"--hotkey-ss58",
"-H",
"--wallet_hotkey",
"--wallet_hotkey_ss58",
"--wallet-hotkey",
"--wallet-hotkey-ss58",
"--wallet.hotkey",
help="Hotkey name or SS58 address of the hotkey",
)
mnemonic = typer.Option(
None,
help='Mnemonic used to regenerate your key. For example: "horse cart dog ..."',
Expand Down Expand Up @@ -3349,7 +3361,7 @@ def stake_move(
network: Optional[list[str]] = Options.network,
wallet_name: Optional[str] = Options.wallet_name,
wallet_path: Optional[str] = Options.wallet_path,
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
wallet_hotkey: Optional[str] = Options.wallet_hotkey_ss58,
origin_netuid: Optional[int] = typer.Option(
None, "--origin-netuid", help="Origin netuid"
),
Expand All @@ -3369,6 +3381,8 @@ def stake_move(
False, "--stake-all", "--all", help="Stake all", prompt=False
),
prompt: bool = Options.prompt,
quiet: bool = Options.quiet,
verbose: bool = Options.verbose,
):
"""
Move staked TAO between hotkeys while keeping the same coldkey ownership.
Expand All @@ -3390,6 +3404,7 @@ def stake_move(

[green]$[/green] btcli stake move
"""
self.verbosity_handler(quiet, verbose)
console.print(
"[dim]This command moves stake from one hotkey to another hotkey while keeping the same coldkey.[/dim]"
)
Expand Down Expand Up @@ -3502,7 +3517,7 @@ def stake_transfer(
network: Optional[list[str]] = Options.network,
wallet_name: Optional[str] = Options.wallet_name,
wallet_path: Optional[str] = Options.wallet_path,
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
wallet_hotkey: Optional[str] = Options.wallet_hotkey_ss58,
origin_netuid: Optional[int] = typer.Option(
None,
"--origin-netuid",
Expand Down
7 changes: 6 additions & 1 deletion bittensor_cli/src/commands/stake/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ async def display_stake_movement_cross_subnets(
subnet = await subtensor.subnet(origin_netuid)
received_amount_tao = subnet.alpha_to_tao(amount_to_move)
received_amount_tao -= MIN_STAKE_FEE

if received_amount_tao < Balance.from_tao(0):
print_error("Not enough Alpha to pay the transaction fee.")
raise ValueError

received_amount = subnet.tao_to_alpha(received_amount_tao)
slippage_pct_float = (
100 * float(MIN_STAKE_FEE) / float(MIN_STAKE_FEE + received_amount_tao)
Expand Down Expand Up @@ -440,7 +445,7 @@ async def move_stake(
):
if interactive_selection:
try:
selection = stake_move_transfer_selection(subtensor, wallet)
selection = await stake_move_transfer_selection(subtensor, wallet)
except ValueError:
return False
origin_hotkey = selection["origin_hotkey"]
Expand Down
Loading