Skip to content

Conversation

@fairlighteth
Copy link
Contributor

Summary

Addresses review feedback in this comment.

Introduce shared helpers in @cowprotocol/common-utils (getTokenAddressKey, getTokenId) and wire them into the token selector, account-proxy hooks, and explorer token list so token IDs/keys are normalized in a single place, preparing for future multi-chain integrations (e.g. Solana) without changing current behavior.

No UI changes; no screenshots.

To Test

  1. CowSwap token selector
  • Open the Swap page and open the token selector; verify the token list loads as before (no missing/duplicated tokens).
  • Switch between supported networks and confirm tokens and favorites still appear correctly per chain.
  • Select a token and reopen the selector; the selected token should remain highlighted and lazy-loaded balances/fiat values should still appear once rows scroll into view.
  1. Account Proxy refunds & balances
  • Navigate to the Account Proxy refund flow and verify the list of refund tokens and their USD amounts render correctly.
  • Confirm aggregate USD totals (where shown) still match the sum of per-token USD amounts.
  • On Account Proxy screens that show token balances, verify balances and USD values match what you see on develop for the same account.
  1. Explorer token list
  • Open the Explorer and navigate to a view that uses the token list (e.g. token search); verify tokens are still found by address and symbol.
  • Confirm native tokens (e.g. ETH, xDAI) still resolve and render correctly in token lookups.

Background

This PR spins off the token-selector waterfall (feat/token-selector-10) to centralize how we compute both normalized token addresses and token IDs. Instead of inlining chainId:address.toLowerCase() or address.toLowerCase() at each call site, everything now goes through getTokenAddressKey and getTokenId, so adapting behavior for chains with case-sensitive addresses (like Solana) can be done in one place.

@vercel
Copy link

vercel bot commented Nov 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
cowfi Ready Ready Preview Dec 15, 2025 10:21am
explorer-dev Ready Ready Preview Dec 15, 2025 10:21am
swap-dev Ready Ready Preview Dec 15, 2025 10:21am
widget-configurator Ready Ready Preview Dec 15, 2025 10:21am
2 Skipped Deployments
Project Deployment Review Updated (UTC)
cosmos Ignored Ignored Dec 15, 2025 10:21am
sdk-tools Ignored Ignored Preview Dec 15, 2025 10:21am

@fairlighteth fairlighteth requested a review from a team November 20, 2025 14:19
@fairlighteth fairlighteth self-assigned this Nov 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/token-selector-11

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Resolved conflict in apps/explorer/src/hooks/useTokenList.ts:
- Combined imports: COW_CDN from @cowprotocol/common-const and getTokenAddressKey from @cowprotocol/common-utils
- Kept COW_CDN URLs from feat/token-selector-10
- Kept getTokenAddressKey normalization from feat/token-selector-11
chainId: number
}

export function getTokenId(token: TokenIdentifier): string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: would be nice to define a type for that like export type TokenId = ${number}:${string}
for better understanding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants