Repository navigation
WalletConnect: chia_updateCat, so a site can suggest a label for a CAT - #893
Merged
Merged
Conversation
A site can suggest a name, ticker, https icon and description for a CAT the wallet already holds (like EIP-747's wallet_watchAsset). The user always confirms in a dialog that warns the labels are the site's, shows the asset id in full, current -> proposed values and an icon preview. Approval updates Sage's own record through update_cat; omitted fields are kept, nothing is signed or spent, and an asset the wallet does not hold is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Are you fine renaming it to |
It edits the wallet's own record of a CAT it already holds, as update_cat does; it does not add an asset to watch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rigidity
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WalletConnect:
chia_updateCat, so a site can suggest a label for a CATWhy
A CAT that Dexie hasn't registered shows up in Sage as "Unknown CAT" with an empty name. Sage reads names and icons from Dexie's asset list, and only the wallet's owner can change them, by hand. Sites that mint CATs their users then hold have no way to say what those tokens are. Examples are DEX liquidity tokens, game items, and project tokens before they're listed. Users end up holding several "Unknown CAT" rows and can't tell them apart.
Ethereum wallets solve a similar problem with
wallet_watchAsset(EIP-747): the site suggests the token's symbol and image, and the user approves or rejects it in a wallet prompt.What
This adds one WalletConnect command,
chia_updateCat. It is named after what it does: it updates the wallet's own record of a CAT it already holds, through the same path asupdate_cat.confirm: true). The dialog warns that the site chose these labels and that anyone can name a token anything. It shows the asset ID in full, each current label → proposed label, and a preview of the proposed icon (loaded withreferrerPolicy='no-referrer').update_catpath, and never adds an asset the wallet has never seen. If the wallet doesn't hold the asset, the request fails with a clear error, and the dialog says so before the user approves.Files
src/walletconnect/commands.ts: the command, with zod validation of the asset ID, the lengths, and https for the icon.src/walletconnect/commands/high-level.ts:handleUpdateCat(getToken, thenupdateCat, merging only the fields provided).src/walletconnect/handler.ts: the dispatch.src/contexts/WalletConnectContext.tsx: theUpdateCatDialogapproval dialog and its title.Not in this PR (possible follow-ups)
sage-appsuser wallet methods), so in-wallet apps can suggest labels too.update_catdoesn't have.Testing
tsc -bandeslintare clean on the touched files.chia_updateCatfrom a dApp over WalletConnect for a held CAT. Approve and check that the token list shows the new name, ticker and icon. Reject and check that nothing changed. Use an unheld asset ID and check that the dialog shows the "does not hold" notice and the request fails.🤖 Generated with Claude Code