feat: add WSOL/SOL as popular token on Solana#2250
Conversation
Adds chain-specific popular tokens support so WSOL appears in the "Popular Tokens" section when Solana is selected. Includes both WSOL and SOL symbols since the /token endpoint returns SOL for wrapped sol.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # src/views/SwapAndBridge/components/ChainTokenSelector/ChainTokenSelectorModal.tsx
| const chainSpecificPopularTokens: Record<number, string[]> = { | ||
| [CHAIN_IDs.SOLANA]: [TOKEN_SYMBOLS_MAP.WSOL.symbol, "SOL"], // SOL is also included because the /token endpoint returns SOL instead of WSOL for wrapped sol | ||
| }; | ||
|
|
There was a problem hiding this comment.
So we specifically don't want to show this as a popular token chains other than Solana?
(If we just added this token symbol to the popular tokens constant then it would show up on all chains that have that token)
There was a problem hiding this comment.
Yeah, that was my assumption. I think it's very Solana-specific. Since we're just looking at the token symbols and not the token contract address, I thought there might be a risk of adding some "garbage" token that's not sold for some of the other chains. But I'm not so sure about the likelihood of this since we're importing curated lists of tokens anyway. If you think that it's a low likelihood, then we could go back to the simpler implementation.
There was a problem hiding this comment.
Ah that's not a bad instinct actually.
But imo since, like you said, a) these are curated lists, and b) we don't do this for any other token symbol on other chains and c) is very unlikely to occur, we could remove this added complexity I think
Adds chain-specific popular tokens support so WSOL appears in the "Popular Tokens" section when Solana is selected. Includes both WSOL and SOL symbols since the /token endpoint returns SOL for wrapped sol.