Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
09c3792
get_all_root_claim_types
ibraheem-abe Oct 29, 2025
eafbc28
add root claim to root metagraph
ibraheem-abe Oct 29, 2025
d143f4d
wip
ibraheem-abe Oct 30, 2025
c499b19
add set_claim_type
ibraheem-abe Oct 30, 2025
8d8bf67
add get_root_claim_type
ibraheem-abe Oct 30, 2025
c75b9f8
add root_set_claim_type command
ibraheem-abe Oct 30, 2025
22803d0
Stop running e2e tests on changelog branches
thewhaleking Oct 30, 2025
e5d5535
Merge pull request #691 from opentensor/fix/thewhaleking/dont-run-e2e…
thewhaleking Oct 30, 2025
64b59ae
change root -> stake
ibraheem-abe Oct 30, 2025
10945f5
update cli
ibraheem-abe Oct 30, 2025
76ab922
add table
ibraheem-abe Oct 30, 2025
0d27f93
add get_staking_hotkeys
ibraheem-abe Oct 30, 2025
816c766
add get_root_claimed_netuid
ibraheem-abe Oct 30, 2025
8b868c2
add claimable_rate_all_subnets
ibraheem-abe Oct 30, 2025
90c6111
claimable_rate_netuid
ibraheem-abe Oct 30, 2025
afe603b
add get_claimable_stake
ibraheem-abe Oct 30, 2025
3b0a3c9
wip
ibraheem-abe Oct 31, 2025
8bfb5ac
add get_claimable_stakes_batch
ibraheem-abe Oct 31, 2025
daaad91
add claimable amount to stake list
ibraheem-abe Oct 31, 2025
6de2151
add supp for live mode
ibraheem-abe Oct 31, 2025
a5cb3fd
add claim type in metagraph
ibraheem-abe Oct 31, 2025
329daca
improve naming
ibraheem-abe Oct 31, 2025
b2bd8e4
update var
ibraheem-abe Nov 1, 2025
5f5f851
_print_claimable_table
ibraheem-abe Nov 1, 2025
c2e20c7
_prompt_claim_selection
ibraheem-abe Nov 1, 2025
8477513
wip
ibraheem-abe Nov 1, 2025
b199c1d
add cmd process_pending_claims
ibraheem-abe Nov 1, 2025
20020c8
adds cli cmd
ibraheem-abe Nov 1, 2025
df213ef
add help text
ibraheem-abe Nov 1, 2025
02892cb
fix stake assignment
ibraheem-abe Nov 1, 2025
88781eb
add json output - set_claim_type
ibraheem-abe Nov 1, 2025
6473aee
update console status
ibraheem-abe Nov 1, 2025
26f36bb
add json process_pending_claims
ibraheem-abe Nov 1, 2025
0f57d32
json_output update to cli
ibraheem-abe Nov 1, 2025
37c62e8
add verbose functionality
ibraheem-abe Nov 1, 2025
07e9c42
update methods
ibraheem-abe Nov 1, 2025
6ccfcbc
final touches
ibraheem-abe Nov 1, 2025
5fa68e3
add aliases
ibraheem-abe Nov 1, 2025
718e1ca
add console status
ibraheem-abe Nov 1, 2025
27683fa
dont prompt for HK
ibraheem-abe Nov 1, 2025
3bd237a
ruff
ibraheem-abe Nov 1, 2025
8d15144
add guardrails
ibraheem-abe Nov 1, 2025
af1d571
update ordering of RootClaimed
ibraheem-abe Nov 4, 2025
9e740c2
add get_all_subnet_ema_tao_inflow
ibraheem-abe Nov 4, 2025
4318006
add tao ema inflow in subnets list
ibraheem-abe Nov 4, 2025
bfccca5
fix import
ibraheem-abe Nov 4, 2025
d327842
Add get_subnet_ema_tao_inflow
ibraheem-abe Nov 4, 2025
693b187
adds inflow ema to subnets metagraph
ibraheem-abe Nov 4, 2025
8799b9e
Merge pull request #692 from opentensor/feat/root-claim
ibraheem-abe Nov 4, 2025
f33ca1b
bumps version and changelog
ibraheem-abe Nov 4, 2025
fe15075
Merge pull request #693 from opentensor/changelog/9150
ibraheem-abe Nov 4, 2025
53822cb
add none check
ibraheem-abe Nov 4, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/e2e-subtensor-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

find-tests:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.draft == false && !startsWith(github.head_ref, 'changelog/')) }}
outputs:
test-files: ${{ steps.get-tests.outputs.test-files }}
steps:
Expand All @@ -43,6 +43,7 @@ jobs:

pull-docker-image:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.draft == false && !startsWith(github.head_ref, 'changelog/')) }}
steps:
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Changelog

## 9.15.0 /2025-11-04

* Stop running e2e tests on changelog branches by @thewhaleking in https://github.com/opentensor/btcli/pull/691
* Feat/root claim by @ibraheem-abe in https://github.com/opentensor/btcli/pull/692

**Full Changelog**: https://github.com/opentensor/btcli/compare/v9.14.3...v9.15.0

## 9.14.3 /2025-10-30
* Allows for installing on Py 3.14 by @thewhaleking in https://github.com/opentensor/btcli/pull/688
* corrects `--name` param in `wallet set-identity` and `subnets set-identity` which was a duplicate param alias of `--wallet-name`
Expand Down
126 changes: 126 additions & 0 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
move as move_stake,
add as add_stake,
remove as remove_stake,
claim as claim_stake,
)
from bittensor_cli.src.commands.subnets import (
price,
Expand Down Expand Up @@ -970,6 +971,12 @@ def __init__(self):
self.stake_app.command(
"swap", rich_help_panel=HELP_PANELS["STAKE"]["MOVEMENT"]
)(self.stake_swap)
self.stake_app.command(
"set-claim", rich_help_panel=HELP_PANELS["STAKE"]["CLAIM"]
)(self.stake_set_claim_type)
self.stake_app.command(
"process-claim", rich_help_panel=HELP_PANELS["STAKE"]["CLAIM"]
)(self.stake_process_claim)

# stake-children commands
children_app = typer.Typer()
Expand Down Expand Up @@ -1144,6 +1151,16 @@ def __init__(self):
self.sudo_app.command("get_take", hidden=True)(self.sudo_get_take)
self.sudo_app.command("set_take", hidden=True)(self.sudo_set_take)

# Stake
self.stake_app.command(
"claim",
hidden=True,
)(self.stake_set_claim_type)
self.stake_app.command(
"unclaim",
hidden=True,
)(self.stake_set_claim_type)

# Crowdloan
self.app.add_typer(
self.crowd_app,
Expand Down Expand Up @@ -7066,6 +7083,115 @@ def view_dashboard(
)
)

def stake_set_claim_type(
self,
wallet_name: Optional[str] = Options.wallet_name,
wallet_path: Optional[str] = Options.wallet_path,
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
network: Optional[list[str]] = Options.network,
prompt: bool = Options.prompt,
quiet: bool = Options.quiet,
verbose: bool = Options.verbose,
json_output: bool = Options.json_output,
):
"""
Set the root claim type for your coldkey.

Root claim types control how staking emissions are handled on the ROOT network (subnet 0):

[bold]Claim Types:[/bold]
• [green]Swap[/green]: Future Root Alpha Emissions are swapped to TAO and added to root stake (default)
• [yellow]Keep[/yellow]: Future Root Alpha Emissions are kept as Alpha tokens

USAGE:

[green]$[/green] btcli root set-claim-type

With specific wallet:

[green]$[/green] btcli root set-claim-type --wallet-name my_wallet
"""
self.verbosity_handler(quiet, verbose, json_output)
wallet = self.wallet_ask(
wallet_name,
wallet_path,
wallet_hotkey,
ask_for=[WO.NAME],
)
return self._run_command(
claim_stake.set_claim_type(
wallet=wallet,
subtensor=self.initialize_chain(network),
prompt=prompt,
json_output=json_output,
)
)

def stake_process_claim(
self,
netuids: Optional[str] = Options.netuids,
wallet_name: Optional[str] = Options.wallet_name,
wallet_path: Optional[str] = Options.wallet_path,
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
network: Optional[list[str]] = Options.network,
prompt: bool = Options.prompt,
quiet: bool = Options.quiet,
verbose: bool = Options.verbose,
json_output: bool = Options.json_output,
):
"""
Manually claim accumulated root network emissions for your coldkey.

[bold]Note:[/bold] The network will eventually process your pending emissions automatically.
However, you can choose to manually claim your emissions with a small extrinsic fee.

A maximum of 5 netuids can be processed in one call.

USAGE:

[green]$[/green] btcli stake process-claim

Claim from specific netuids:

[green]$[/green] btcli stake process-claim --netuids 1,2,3

Claim with specific wallet:

[green]$[/green] btcli stake process-claim --netuids 1,2 --wallet-name my_wallet

"""
self.verbosity_handler(quiet, verbose, json_output)

parsed_netuids = None
if netuids:
parsed_netuids = parse_to_list(
netuids,
int,
"Netuids must be a comma-separated list of ints, e.g., `--netuids 1,2,3`.",
)

if len(parsed_netuids) > 5:
print_error("Maximum 5 netuids allowed per claim")
return

wallet = self.wallet_ask(
wallet_name,
wallet_path,
wallet_hotkey,
ask_for=[WO.NAME],
)

return self._run_command(
claim_stake.process_pending_claims(
wallet=wallet,
subtensor=self.initialize_chain(network),
netuids=parsed_netuids,
prompt=prompt,
json_output=json_output,
verbose=verbose,
)
)

def liquidity_add(
self,
network: Optional[list[str]] = Options.network,
Expand Down
1 change: 1 addition & 0 deletions bittensor_cli/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ class RootSudoOnly(Enum):
"STAKE_MGMT": "Stake Management",
"CHILD": "Child Hotkeys",
"MOVEMENT": "Stake Movement",
"CLAIM": "Root Claim Management",
},
"SUDO": {
"CONFIG": "Subnet Configuration",
Expand Down
Loading
Loading