[READY] Change token selection list sort. 1. Balance 2. Hardcoded tokens 3. Alphabetically#1058
Conversation
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates token metadata and UI behavior to improve token selection UX: bringing in a dynamic EVM token list from Squid Router, merging it with static config, and sorting tokens primarily by balances (USD/raw) and then by priority/alphabetical order. It also removes the networkAssetIcon property across token types/configs and aligns the axlUSDC display symbol with Squid Router naming.
Changes:
- Add/adjust dynamic EVM token ingestion + merging with static config (and mark static tokens via
isFromStaticConfigfor sorting priority). - Update token selection list sorting to prioritize USD balance, then raw balance, then static-config tokens, then alphabetical.
- Remove
networkAssetIconfrom token types/configs and update frontend icon plumbing accordingly (plus rename axlUSDC symbol toUSDC.axlin static configs).
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/shared/src/tokens/utils/helpers.ts | Adds a special-case fallback for AXLUSDC on Ethereum when resolving token details. |
| packages/shared/src/tokens/types/evm.ts | Removes networkAssetIcon; adds isFromStaticConfig to support sort prioritization. |
| packages/shared/src/tokens/types/assethub.ts | Removes networkAssetIcon from AssetHub token details. |
| packages/shared/src/tokens/moonbeam/config.ts | Renames axlUSDC symbol to USDC.axl and removes icon field usage. |
| packages/shared/src/tokens/evm/dynamicEvmTokens.ts | Fetches/filters Squid Router tokens, generates fallback logo URIs, merges with static config, and marks static tokens. |
| packages/shared/src/tokens/evm/config.ts | Removes networkAssetIcon, removes AXLUSDC from Ethereum config, and renames axlUSDC symbol to USDC.axl elsewhere. |
| packages/shared/src/tokens/assethub/config.ts | Removes networkAssetIcon from AssetHub static token config. |
| packages/shared/src/services/squidrouter/config.ts | Refactors imports to use helpers and direct Moonbeam token config export. |
| bun.lock | Removes react-window and upgrades @galacticcouncil/sdk lock entry. |
| apps/frontend/src/hooks/useTokenIcon.ts | Simplifies logo URI extraction (EVM includes fallbackLogoURI). |
| apps/frontend/src/components/buttons/AssetButton/index.tsx | Improves fallback icon source selection when a token has a fallbackLogoURI. |
| apps/frontend/src/components/TokenSelection/TokenSelectionList/helpers.tsx | Adjusts token definition mapping for AssetHub/EVM tokens (asset icon fields now based on symbol). |
| apps/frontend/src/components/TokenSelection/TokenSelectionList/components/SelectionTokenList.tsx | Implements updated token sorting logic (balances → static-config priority → alphabetical). |
| apps/frontend/src/components/TokenIcon/index.tsx | Tweaks image error handling/loading behavior for primary vs fallback icon. |
| apps/frontend/src/components/Ramp/Onramp/index.tsx | Uses assetSymbol instead of removed networkAssetIcon for input components. |
| apps/frontend/src/components/Ramp/Offramp/index.tsx | Uses assetSymbol instead of removed networkAssetIcon for input components. |
| apps/frontend/src/components/CurrencyExchange/index.tsx | Ensures fallback icon props are correctly derived when not explicitly provided. |
| apps/api/src/api/services/hydration/swap.ts | Adds PoolType.Aave to Hydration router pool include list. |
| apps/api/package.json | Upgrades @galacticcouncil/sdk to ^10.6.2. |
Comments suppressed due to low confidence (1)
apps/frontend/src/components/buttons/AssetButton/index.tsx:45
useTokenIconis called asuseTokenIcon(assetIcon)without passingnetwork, so for on-chain tokens it can only fall back to fiat icons (which resolves to the placeholder). IflogoURIisn’t provided (e.g., Squid token fetch fails or a token lackslogoURI), the button will show a placeholder even when on-chain token details for the givennetworkcould provide alogoURI/fallbackLogoURI. Consider callinguseTokenIcon(tokenSymbol, network)(oruseTokenIcon(assetIcon, network)) so the fallback chain can resolve on-chain icons reliably.
fallbackIconSrc={fallbackLogoURI ?? fallbackIcon.fallbackIconSrc}
iconSrc={primaryIcon}
network={network}
showNetworkOverlay={!!network}
tokenSymbol={assetIcon}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot please address your suggested changes from #1058 (review) in a new PR. |
- Fix mergeWithStaticConfig to preserve static config enum keys (e.g., EvmToken.AXLUSDC) - Add alias entries under normalized symbols for flexible lookups - Remove special case for AXLUSDC in getOnChainTokenDetailsOrDefault - This fixes broken enum-based lookups like getOnChainTokenDetails(..., EvmToken.AXLUSDC) Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Fix token lookup keying: preserve enum keys in dynamic EVM token merge
ebma
left a comment
There was a problem hiding this comment.
I added some more failsafes, but should be fine overall ✔️
Optimize token selection and balances
Summary
(static takes priority for contract addresses)
(isFromStaticConfig), then alphabetically
naming
Test plan
static-config tokens above dynamic-only tokens when balances are equal
fallback chain works when primary icon URL fails
removal
tokens