Repository navigation
fix: RPC fallback transports and native balance display for weth wrappers - #5
Merged
Merged
Conversation
Contributor
|
Preview deployed for |
Contributor
|
Preview deployed for |
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.
Root cause of "can't send WBNB even though I have BNB": the app builds every wagmi transport from
rpcUrls[0]only, and BSC Testnet's first RPC (bsc-testnet-rpc.publicnode.com) is currently returning 503s. Every chapel read — balance multicall,isWeth(), hostfeeToken— failed, so the form fell back to an empty balance and blocked the send with "Insufficient funds". The weth/native logic itself was already correct.wagmi.ts: transports now use viem'sfallback()across all configuredrpcUrlsinstead of only the first, so one flaky endpoint no longer zeroes out balances or blocks sends chain-wide.evm-networks.ts: BSC Testnet RPC order now starts withdata-seed-prebsc-1-s1.bnbchain.org(verified serving the balance multicall and contract reads), keeping publicnode as a fallback. Also fixes the SDK path (EvmChain.createusesrpcUrls[0]).balance-helper.ts: forwrapped-hfttokens withweth: true, the form balance now shows the chain's native symbol and value (e.g.tBNB) instead of the wrapper's registry symbol, since that is what the user actually spends. Non-weth wrappers keep showing the underlying ERC20 balance.Verified the exact multicall
getEthBalancerequest andisWeth()read against the new primary RPC, and that the transport fallback walks all four endpoints in order. Type-check clean, 110 tests pass.