Add BNB Chain support to bridge and balance breakdown#2117
Merged
Conversation
Add Binance-Peg USD Coin (USDC, 0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d)
on BNB Chain as a new bridge deposit source in the Add Funds ("send from
your crypto wallet" + "share your deposit address") and Deposit-to-Savings
(USDC vault) flows, alongside Polygon/Arbitrum.
- constants/bridge.ts: BSC entry (USDC, 18 decimals, isPermit false) + gold
circular BNB icon; add optional decimals to BridgeToken type
- lib/thirdweb.ts: register bsc chain so switchChain works in the
connected-wallet deposit flow
- hooks/useDepositFromEOA.ts: derive source-token decimals from the bridge
config instead of hardcoding 6 (BSC USDC is 18 decimals)
- constants/alchemy.ts: enable BSC token-balance fetching via Alchemy
- components/Coin/BalanceBreakdown.tsx: map the BSC chain icon + name in the
coin detail network breakdown
- assets/images/bsc.png + lib/assets.ts: circular gold BNB Chain icon
https://claude.ai/code/session_013JRn2tvDbZssJGAx4b6gJX
|
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
This PR adds support for BNB Chain (BSC) to the bridge functionality and balance breakdown components. It includes configuration for USDC bridging on BSC and integrates BSC with the Alchemy data provider.
Key Changes
BRIDGE_TOKENSwith Binance-Peg USDC (18 decimals) supportBridgeTokentype with optionaldecimalsfield and updated deposit logic to dynamically derive token decimals from bridge config instead of hardcoding to 6bsc.png)Notable Implementation Details
useDepositFromEOAhook now dynamically determines source token decimals from the bridge configuration, accommodating chains like BSC where USDC uses 18 decimals instead of the standard 6https://claude.ai/code/session_013JRn2tvDbZssJGAx4b6gJX