Skip to content
Open
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
47 changes: 37 additions & 10 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2913,32 +2913,47 @@ def wallet_inspect(
),
wallet_name: str = Options.wallet_name,
wallet_path: str = Options.wallet_path,
wallet_hotkey: str = Options.wallet_hotkey,
ss58_address: Optional[str] = typer.Option(
None,
"--ss58-address",
"--ss58",
help="SS58 address of the coldkey to inspect. Allows inspecting any coldkey without a local wallet file.",
),
network: Optional[list[str]] = Options.network,
netuids: str = Options.netuids,
quiet: bool = Options.quiet,
verbose: bool = Options.verbose,
json_output: bool = Options.json_output,
):
"""
Displays the details of the user's wallet pairs (coldkey, hotkey) on the Bittensor network.
Displays the details of the user's wallet (coldkey) on the Bittensor network.

The output is presented as two separate tables:

The output is presented as a table with the below columns:
[bold]Coldkey Overview[/bold]:

- [blue bold]Coldkey[/blue bold]: The coldkey associated with the user's wallet.

- [blue bold]Balance[/blue bold]: The balance of the coldkey.

- [blue bold]Delegate[/blue bold]: The name of the delegate to which the coldkey has staked TAO.

- [blue bold]Stake[/blue bold]: The amount of stake held by both the coldkey and hotkey.
- [blue bold]Stake[/blue bold]: The amount of stake delegated.

- [blue bold]Emission[/blue bold]: The emission or rewards earned from staking.
- [blue bold]Emission[/blue bold]: The daily emission earned from delegation.

- [blue bold]Netuid[/blue bold]: The network unique identifier of the subnet where the hotkey is active (i.e., validating).
[bold]Hotkey Details[/bold]:

- [blue bold]Coldkey[/blue bold]: The parent coldkey of the hotkey.

- [blue bold]Netuid[/blue bold]: The network unique identifier of the subnet where the hotkey is active.

- [blue bold]Hotkey[/blue bold]: The hotkey associated with the neuron on the network.

- [blue bold]Stake[/blue bold]: The amount of stake held by the hotkey.

- [blue bold]Emission[/blue bold]: The emission or rewards earned from staking.

USAGE

This command can be used to inspect a single wallet or all the wallets located at a specified path. It is useful for a comprehensive overview of a user's participation and performance in the Bittensor network.
Expand All @@ -2949,10 +2964,10 @@ def wallet_inspect(

[green]$[/green] btcli wallet inspect --all -n 1 -n 2 -n 3

[green]$[/green] btcli wallet inspect --ss58-address 5FHneW46...

[bold]Note[/bold]: The `inspect` command is for displaying information only and does not perform any transactions or state changes on the blockchain. It is intended to be used with Bittensor CLI and not as a standalone function in user code.
"""
print_error("This command is disabled on the 'rao' network.")
raise typer.Exit()
self.verbosity_handler(quiet, verbose, json_output, False)

if netuids:
Expand All @@ -2962,14 +2977,26 @@ def wallet_inspect(
"Netuids must be a comma-separated list of ints, e.g., `--netuids 1,2,3,4`.",
)

self.initialize_chain(network)

if ss58_address:
return self._run_command(
wallets.inspect(
None,
self.subtensor,
netuids_filter=netuids,
all_wallets=False,
ss58_address=ss58_address,
)
)

# if all-wallets is entered, ask for path
ask_for = [WO.NAME, WO.PATH] if not all_wallets else [WO.PATH]
validate = WV.WALLET if not all_wallets else WV.NONE
wallet = self.wallet_ask(
wallet_name, wallet_path, wallet_hotkey, ask_for=ask_for, validate=validate
wallet_name, wallet_path, None, ask_for=ask_for, validate=validate
)

self.initialize_chain(network)
return self._run_command(
wallets.inspect(
wallet,
Expand Down
Loading