feat(balances): enable BSC chain to surface stuck funds#2107
Merged
Conversation
Fetch BSC balances (ERC-20 via Alchemy + native BNB via viem) the same way Arbitrum, Base, and Ethereum are handled. Wire BSC through wagmi chains/transports and add BNB to native token + CoinGecko price lookups. The Send token list now includes BSC tokens and falls back to the viem chain name when a chain isn't in BRIDGE_TOKENS, so BSC entries don't crash the row label. BSC is Alchemy-only — Blockscout has no BSC instance and the existing fallback returns [] gracefully on Alchemy failure. Unblocks users who accidentally sent BEP-20 USDC (or any other token) to their Solid safe address on BSC.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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.
Summary
Enable BSC (chain 56) so users who accidentally sent BEP-20 tokens (e.g. Binance-Peg USDC from tx 0x7f395780) to their Solid safe address can see and transfer those funds.
Changes
constants/alchemy.ts— BSC added to Alchemy supported chains (bnb-mainnet.g.alchemy.com).lib/wagmi.ts— BSC wired into chains array, RPC URLs, and transports.constants/tokens.ts— BNB added toNATIVE_TOKENSandNATIVE_COINGECKO_TOKENS.hooks/useBalances.ts— fetches BSC ERC-20s via Alchemy dispatcher + native BNB via viem, processes into newbscTokensarray.hooks/useWalletTokens.ts— re-exportsbscTokens, includes inhasTokens.components/Send/TokenSelector.tsx— combines BSC into the token list; falls back to viem's chain name whenBRIDGE_TOKENShas no entry for the chain (so BSC rows don't crash on.name).Data source
BSC is Alchemy-only — public Blockscout has no BSC instance. The existing
fetchTokenBalancesWithFallbackdispatcher returns[]from the Blockscout path if Alchemy fails (no URL configured), so the fail-open behavior is preserved.Backend action required (not in this PR)
Insert Binance-Peg USDC into the
swap-tokensMongoDB collection, orfilterTokenListinuseBalances.tswill hide it:{ "name": "Binance-Peg USD Coin", "symbol": "USDC", "address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", "decimals": 18, "chainId": 56, "isActive": true }Note: 18 decimals (not 6 like canonical USDC).
Test plan
swap-tokenscollection in QA Mongo.USDC on BNB Smart Chain(fallback chain name from viem).Generated by Claude Code