Skip to content
Open
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
48 changes: 39 additions & 9 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,9 @@ def config_add_proxy(
):
"""
Adds a new pure proxy to the address book.

[bold]Example:[/bold]
[green]$[/green] btcli config add-proxy
"""
if self.proxies.get(name) is not None:
err_console.print(
Expand Down Expand Up @@ -2052,6 +2055,9 @@ def config_remove_proxy(
Removes a pure proxy from the address book.

Note: Does not remove the proxy on chain. Only removes it from the address book.

[bold]Example:[/bold]
[green]$[/green] btcli config remove-proxy --name test-proxy
"""
if name in self.proxies:
del self.proxies[name]
Expand All @@ -2065,6 +2071,9 @@ def config_remove_proxy(
def config_get_proxies(self):
"""
Displays the current proxies address book

[bold]Example:[/bold]
[green]$[/green] btcli config proxies
"""
table = Table(
Column("[bold white]Name", style=f"{COLORS.G.ARG}"),
Expand Down Expand Up @@ -2113,6 +2122,14 @@ def config_update_proxy(
delay: Optional[int] = typer.Option(None, help="Delay, in blocks."),
note: Optional[str] = typer.Option(None, help="Any notes about this entry"),
):
"""
Updates the details of a proxy in the address book.

Note: This command not update the proxy on chain. It only updates it on the address book.

[bold]Example:[/bold]
[green]$[/green] btcli config update-proxy --name test-proxy
"""
if name not in self.proxies:
err_console.print(f"Proxy {name} not found in address book.")
return
Expand Down Expand Up @@ -9364,16 +9381,11 @@ def proxy_remove(

Revokes proxy permissions previously granted to another account. This prevents the delegate account from executing any further transactions on your behalf.

[bold]Note[/bold]: You can specify a delegate to remove a single proxy or use the `--all` flag to remove all existing proxies linked to an account.


[bold]Common Examples:[/bold]
1. Revoke proxy permissions from a single proxy account
[bold]Example:[/bold]
Revoke proxy permissions from a single proxy account
[green]$[/green] btcli proxy remove --delegate 5GDel... --proxy-type Transfer

2. Remove all proxies linked to an account
[green]$[/green] btcli proxy remove --all

"""
# TODO should add a --all flag to call Proxy.remove_proxies ?
logger.debug(
Expand Down Expand Up @@ -9532,7 +9544,25 @@ def proxy_execute_announced(
verbose: bool = Options.verbose,
json_output: bool = Options.json_output,
):
self.verbosity_handler(quiet, verbose, json_output, prompt, decline)
"""
Executes a previously announced proxy call.

This command submits the inner call on-chain using the proxy relationship. The command will fail if the required delay has not passed or if the call does not match the announcement parameters.

If you do not provide the call hash or call hex of the announced call in the command, you would be prompted to enter details of the call including the module name and call function.

[bold]Note[/bold]: Using the `--call-hash` flag attempts to resolve the call from the proxy announcement address book. Use this flag only if the announcement was created through BTCLI.
If the announcement was created by any other method, you must provide the call using `--call-hex` or rebuild the call explicitly via the command prompts.

[bold]Common Examples:[/bold]
1. Using the call hash
[green]$[/green] btcli proxy execute --call-hash caf4da69610d379c2e2e5...0cbc6b012f6cff6340c45a1

2. Using the call hex
[green]$[/green] btcli proxy execute --call-hex 0x0503008f0667364ff11915b0b2a54387...27948e8f950f79a69cff9c029cdb69

"""
self.verbosity_handler(quiet, verbose, json_output, prompt)
outer_proxy_from_config = self.proxies.get(proxy, {})
proxy_from_config = outer_proxy_from_config.get("address")
delay = 0
Expand Down Expand Up @@ -9644,7 +9674,7 @@ def proxy_execute_announced(
else:
console.print(
f"The call hash you have provided matches {len(potential_call_matches)}"
f" possible entries. The results will be iterated for you to selected your intended"
f" possible entries. The results will be iterated for you to select your intended "
f"call."
)
for row in potential_call_matches:
Expand Down
Loading