Skip to content
Merged
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
24 changes: 18 additions & 6 deletions bittensor/_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,15 +742,27 @@ def check_transfer_config( config: 'bittensor.Config'):
sys.exit()
else:
config.dest = str(dest)

# Get current balance and print to user.
if not config.no_prompt:
wallet = bittensor.wallet( config )
subtensor = bittensor.subtensor( config )
with bittensor.__console__.status(":satellite: Checking Balance..."):
account_balance = subtensor.get_balance( wallet.coldkeypub.ss58_address )
bittensor.__console__.print("Balance: [green]{}[/green]".format(account_balance))

# Get amount.
if not config.get('amount'):
amount = Prompt.ask("Enter Tao amount to transfer")
try:
config.amount = float(amount)
except ValueError:
console.print(":cross_mark:[red] Invalid Tao amount[/red] [bold white]{}[/bold white]".format(amount))
sys.exit()
if not config.no_prompt:
amount = Prompt.ask("Enter TAO amount to transfer")
try:
config.amount = float(amount)
except ValueError:
console.print(":cross_mark:[red] Invalid TAO amount[/red] [bold white]{}[/bold white]".format(amount))
sys.exit()
else:
console.print(":cross_mark:[red] Invalid TAO amount[/red] [bold white]{}[/bold white]".format(amount))
sys.exit(1)

def check_unstake_config( config: 'bittensor.Config' ):
if config.subtensor.get('network') == bittensor.defaults.subtensor.network and not config.no_prompt:
Expand Down