def METHOD_NAME(cli):
    r"""Lists wallets."""
    try:
        wallets = next(os.walk(os.path.expanduser(cli.config.wallet.path)))[1]
    except StopIteration:
        # No wallet files found.
        wallets = []
    root = Tree("Wallets")
    for w_name in wallets:
        wallet_for_name = bittensor.wallet(path=cli.config.wallet.path, name=w_name)
        try:
            if (
                wallet_for_name.coldkeypub_file.exists_on_device()
                and not wallet_for_name.coldkeypub_file.is_encrypted()
            ):
                coldkeypub_str = wallet_for_name.coldkeypub.ss58_address
            else:
                coldkeypub_str = "?"
        except:
            coldkeypub_str = "?"
        wallet_tree = root.add(
            "\n[bold white]{} ({})".format(w_name, coldkeypub_str)
        )
        hotkeys_path = os.path.join(cli.config.wallet.path, w_name, "hotkeys")
        try:
            hotkeys = next(os.walk(os.path.expanduser(hotkeys_path)))
            if len(hotkeys) > 1:
                for h_name in hotkeys[2]:
                    hotkey_for_name = bittensor.wallet(
                        path=cli.config.wallet.path, name=w_name, hotkey=h_name
                    )
                    try:
                        if (
                            hotkey_for_name.hotkey_file.exists_on_device()
                            and not hotkey_for_name.hotkey_file.is_encrypted()
                        ):
                            hotkey_str = hotkey_for_name.hotkey.ss58_address
                        else:
                            hotkey_str = "?"
                    except:
                        hotkey_str = "?"
                    wallet_tree.add("[bold grey]{} ({})".format(h_name, hotkey_str))
        except:
            continue
    if len(wallets) == 0:
        root.add("[bold red]No wallets found.")
    # Uses rich print to display the tree.
    print(root)