Skip to content

Feat/root claim in wallet change default bittensor validator - #1407

Open
UrbanWill wants to merge 5 commits into
mainfrom
feat/root-claim-in-wallet-change-default-bittensor-validator
Open

Feat/root claim in wallet change default bittensor validator#1407
UrbanWill wants to merge 5 commits into
mainfrom
feat/root-claim-in-wallet-change-default-bittensor-validator

Conversation

@UrbanWill

@UrbanWill UrbanWill commented Aug 27, 2026

Copy link
Copy Markdown
Member

Bittensor staking: remark constant, root claim guidance, rewards removal + dep bumps

Summary

Changes to the Bittensor (subtensor) staking flow in the portal, plus a dependency audit fix:

  1. Centralize the stake remark — introduce a TALISMAN_STAKE_REMARK constant ('paprika005') and use it for every remarkWithEvent call, replacing the hardcoded 'talisman-bittensor' string.
  2. Guide root stake claims to the Talisman wallet — root subnet (netuid 0) rewards can't be claimed from the portal, so the positions table now renders a Claim button that points users to the Talisman wallet.
  3. Remove reward calculations for bittensor positions — the "Total rewards (all time)" column no longer computes or displays anything for bittensor rows, dropping an expensive all-pages delegation-event fetch.
  4. Patch dependency audit advisories — bump postcss and eslint.

Changes

Stake remark constant

  • Add TALISMAN_STAKE_REMARK = 'paprika005' in constants.ts.
  • Replace all remarkWithEvent('talisman-bittensor') calls with remarkWithEvent(TALISMAN_STAKE_REMARK) in forms.ts and useMoveStake.ts.

Single source of truth for the on-chain remark tag, so future changes touch one line.

Root stake claim button

  • Add TALISMAN_WALLET_DOWNLOAD_URL = 'https://talisman.xyz/download' in constants.ts.
  • In StakeItemRow, render a claimButton only for root stakes (netuid === ROOT_NETUID):
    • Claim button with an Info leading icon.
    • Tooltip on hover: "Root subnet rewards are claimed in the Talisman wallet. Click to download."
    • Click opens the Talisman wallet download page in a new tab (noopener,noreferrer).
  • Non-root positions are unchanged (empty claim cell).

Remove reward calculations for bittensor positions

Bittensor reward totals were derived by paginating every delegation event for the nominator, then summed and shown in the "Total rewards (all time)" column. Removed entirely; the column now renders nothing for bittensor rows.

  • Delete useGetRewardsByNominator and its only-consumers useGetInfiniteDelegationEvents and useGetDTaoStakedBalances.
  • Drop rewards / rewardsFormatted fields and isRewardsLoading from useStake / StakeItem.
  • Stop passing rewards, fiatRewards, isRewardsLoading from StakeItemRow; the shared StakePosition recipe auto-hides the column when both are absent (shouldRenderTotalRewards = props.rewards || props.fiatRewards).

Scoped to subtensor only — other providers (nom pools, dApp staking, validators, Lido, seek) keep their reward totals, and the shared recipe is untouched.

Dependency audit fixes

  • postcss ^8.5.19^8.5.26 — fixes GHSA-fxqj-rqcc-2cmp (arbitrary .map read via attacker-controlled sourceMappingURL when from is unset).
  • eslint ^9.2.0^9.39.5 — move to the latest supported 9.x.

Note: the eslint deprecation advisory only fully clears on eslint 10, which is currently blocked upstream — eslint-plugin-react (latest 7.37.5) declares peer support only up to ^9.7. Held at latest 9.x until it ships v10 support.

Testing

  • tsc --noEmit passes.
  • Root stake position renders the Claim button; hover shows the tooltip; click opens the wallet download page.
  • Non-root positions render no claim button.
  • Rewards column renders nothing for bittensor rows; other providers' reward totals unchanged.

Root subnet (netuid 0) rewards can't be claimed from the portal. Render a
Claim button in the claim column for root stakes that opens the Talisman
wallet download page, with a tooltip explaining where to claim.
alecdwm
alecdwm previously approved these changes Aug 27, 2026
- postcss ^8.5.19 -> ^8.5.26: fixes GHSA-fxqj-rqcc-2cmp (arbitrary .map
  read via attacker-controlled sourceMappingURL when  is unset).
- eslint ^9.2.0 -> ^9.39.5: move to latest supported 9.x. Full clear of
  the deprecation advisory needs eslint 10, blocked upstream until
  eslint-plugin-react publishes v10 peer support.
alecdwm
alecdwm previously approved these changes Aug 27, 2026
Bittensor reward totals were derived by paginating every delegation event
for the nominator, then summed and shown in the "Total rewards (all time)"
column on the staking positions page.

Remove that calculation and render nothing in the rewards column for
bittensor rows:

- Delete useGetRewardsByNominator and its only-consumers
  useGetInfiniteDelegationEvents and useGetDTaoStakedBalances.
- Drop rewards/rewardsFormatted and isRewardsLoading from useStake/StakeItem.
- Stop passing rewards, fiatRewards, isRewardsLoading from StakeItemRow;
  the shared recipe auto-hides the column when both are absent.

Scoped to subtensor only; other providers keep their reward totals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants