fix(eth): TxidPage missing explorer link for swaps/sends#53
Open
BitHighlander wants to merge 1 commit intodevelopfrom
Open
fix(eth): TxidPage missing explorer link for swaps/sends#53BitHighlander wants to merge 1 commit intodevelopfrom
BitHighlander wants to merge 1 commit intodevelopfrom
Conversation
The transaction_complete message broadcast by sendTransaction reads
explorerTxLink from currentProvider, but two SET_ASSET_CONTEXT code
paths constructed the provider without that field:
- The fallback path that builds providerData from EIP155_CHAINS when
blockchainDataStorage has no entry (background/index.ts:996) was
copying chainId / caip / name / providerUrl but dropping
explorerTxLink (and networkId, which we also need for fallback
resolution).
When the user completed a Uniswap swap from this state, TxidPage
received explorerUrl=undefined and rendered the txid as plain text
with no link — confirmed in production today after a successful
LINK swap landed at 0x6954a533…94b27968a9.
Two fixes:
1. Carry explorerTxLink (and networkId) into providerData in the
EIP155_CHAINS fallback so future sends have the link available.
2. Safety-net in sendTransaction: if currentProvider.explorerTxLink
is missing, look it up from EIP155_CHAINS by networkId before
firing transaction_complete. Catches any remaining stored state
built by older code paths.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Symptom
After a successful Uniswap swap (and ETH-side sends in general), the Transaction Complete card in the side panel rendered the txid as plain hex with no link — no inline anchor, no "View on Explorer" button. Reproduced today on a successful LINK swap at `0x6954a533…94b27968a9`.
Root cause
`sendTransaction` reads `currentProvider.explorerTxLink` when broadcasting `transaction_complete` to the side panel. Two `SET_ASSET_CONTEXT` code paths built that provider object without the field:
When a user picked Ethereum from the side-panel header (which goes through this fallback), the stored provider had no explorer URL → `transaction_complete` fired with `explorerTxLink: undefined` → `TxidPage` got no link to render → bare hex.
`switchToProvider` (the `wallet_switchEthereumChain` path) already handled it correctly by carrying through whatever the dApp passed.
Fix
`TxidPage` itself was already correctly handling `explorerUrl` — it renders a clickable link + a "View on Explorer" button when present. The bug was upstream.
Test plan
🤖 Generated with Claude Code