Skip to content

fix(connect-evm): normalize account request returns#297

Merged
wenfix merged 3 commits into
mainfrom
fix/requestAccounts-return
May 18, 2026
Merged

fix(connect-evm): normalize account request returns#297
wenfix merged 3 commits into
mainfrom
fix/requestAccounts-return

Conversation

@wenfix
Copy link
Copy Markdown
Contributor

@wenfix wenfix commented May 14, 2026

Explanation

This fixes the EIP-1193 return shapes for intercepted Connect EVM account requests while preserving the existing request routing through the Connect EVM interceptor and connect() flow.

Previously, provider.request({ method: 'eth_requestAccounts' }) resolved to the higher-level client.connect() result:

{ accounts, chainId }

EIP-1193 consumers expect the method-specific result instead, so eth_requestAccounts now resolves to the accounts array:

accounts

The same audit found eth_coinbase sharing the eth_accounts handler and returning the full accounts array. eth_coinbase now resolves to the selected account, while eth_accounts continues to resolve to the full accounts array.

wallet_requestPermissions intentionally keeps the existing Connect EVM return shape for this PR.

References

Testing

  • yarn workspace @metamask/connect-evm test:unit
  • yarn tsc --noEmit -p packages/connect-evm/tsconfig.json

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@wenfix wenfix requested a review from a team as a code owner May 14, 2026 12:08
jiexi
jiexi previously approved these changes May 15, 2026
@wenfix wenfix merged commit ab5d1b6 into main May 18, 2026
20 checks passed
@wenfix wenfix deleted the fix/requestAccounts-return branch May 18, 2026 13:59
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.

3 participants