Skip to content

feat: Pioneer-sourced EVM chain registry + Solana sign-message UX#57

Merged
BitHighlander merged 2 commits intodevelopfrom
feat/pioneer-evm-registry-solana-ux
Apr 30, 2026
Merged

feat: Pioneer-sourced EVM chain registry + Solana sign-message UX#57
BitHighlander merged 2 commits intodevelopfrom
feat/pioneer-evm-registry-solana-ux

Conversation

@BitHighlander
Copy link
Copy Markdown
Collaborator

Summary

  • Pioneer-sourced EVM chain registry replacing the static EIP155_CHAINS table. chains.ts is deleted; chain metadata + RPC URLs come from GET /api/v1/discovery/caip/{caip} on demand, in-memory cached (1h TTL on hits, 1m on misses, inflight coalescing). Closes the three-way mismatch where the network dropdown advertised BNB Smart Chain but wallet_switchEthereumChain rejected it because chains.ts was missing eip155:56.
  • One-step add+switch in wallet_switchEthereumChain — when Pioneer recognizes the chain (~196 EVMs today), we provision the provider, persist to blockchainDataStorage, and switch immediately. The chain-not-enabled card is now a true last resort (Pioneer also doesn't know it) instead of the default response to "you didn't pre-register this chain."
  • Friendly fallback popupChainNotEnabledCard shows the requested chainId, the dApp URL, and a Chainlist link. Surfaces in the side panel before the EIP-3326 4902 still goes back to the dApp.
  • Solana sign-message popup polish — was rendering "Unknown Method / TO: N/A / AMOUNT: N/A". Now decodes the message bytes (UTF-8 with hex fallback), shows the actual text the dApp is asking the user to sign, and labels the request "Sign Solana Message" with appropriate copy for signMessage / signOffchainMessage / signTransaction / signAndSendTransaction.
  • Hardware-friendly timeouts — vault Solana sign endpoints bumped 30s→300s (matches the injected-script callback ceiling, so the vault never aborts before the user can act).
  • Friendlier timeout error UI — yellow "Took too long" warning with retry-from-dApp guidance instead of red "Error Occurred" panel.

Files

  • New: chrome-extension/src/background/chains/registry.ts — Pioneer chain catalog client
  • New: chrome-extension/src/background/popup.tsopenSidePanel / setApprovalBadge extracted (breaks circular import between methods.ts and chain handlers)
  • New: pages/side-panel/src/approval/ChainNotEnabledCard.tsx
  • Deleted: chrome-extension/src/background/chains.ts
  • Modified: ethereumHandler.ts (switch handler rewrite), index.ts (5 call sites + Pioneer-sourced default provider), solanaHandler.ts (timeouts), Transaction.tsx, RequestMethodCard.tsx, RequestDetailsCard.tsx, methods.ts (helper imports), feeFloors.ts (comment)

Test plan

  • Reload extension → BSC switch from a dApp (e.g. pump.fun, app.uniswap.org) succeeds in one round trip; BNB Smart Chain auto-appears in the network dropdown
  • Switch to a Pioneer-known chain you haven't visited before (e.g. Mantle 0x1388, Linea 0xe708) — should add+switch in one step
  • Switch to a Pioneer-unknown chainId (e.g. 0xfffffe) — chain-not-enabled card surfaces with Chainlist link, dApp gets 4902
  • User-added custom networks (Add Network UI) still take precedence over Pioneer (custom RPC overrides honored)
  • ETH default provider initialization works on a fresh install (no web3ProviderStorage entry yet)
  • Solana signMessage from a dApp shows "Sign Solana Message" with the actual decoded message text in the popup
  • Solana sign request that takes >30s no longer errors; can complete up to 5 minutes
  • Trigger a sign-message timeout — popup shows yellow "Took too long" card, not the red error panel

🤖 Generated with Claude Code

BitHighlander and others added 2 commits April 29, 2026 23:33
Replace static chains.ts with a Pioneer-backed registry. wallet_switchEthereumChain now does a one-step add+switch when Pioneer recognizes the chain (covers ~196 EVMs), falling back to a friendly chain-not-enabled card with a Chainlist link only when Pioneer also doesn't know it. Also fixes the Solana sign-message popup's "Unknown Method" / N-A details.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ssage, badge cleanup

- P1: handleEthChainId/handleNetVersion accept either hex or decimal stored chainId. Pioneer-discovered chains store hex ('0x38') and parseInt('0x38', 10) was returning 0, so dApps were getting eth_chainId=0x0 after a Pioneer-driven switch.
- P2a: GET_ASSET_BALANCE and VALIDATE_ERC20_TOKEN now check blockchainDataStorage before falling to Pioneer, so user-customized RPCs in the Add Network UI take precedence on Pioneer-known chains too.
- P2b: RequestDetailsCard reads unsignedTx.messageUtf8/message for solana_signOffchainMessage (params[0] is an object there, not raw bytes — decodeMessage was producing an empty render).
- P3: ChainNotEnabledCard sends CLEAR_APPROVAL_BADGE on close; new background handler in index.ts clears the badge. Without this, dismissing the info card left the extension badge stuck on '!'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant