Skip to content

feat: Add wallet_connect (ERC-7846) support for Base Account connections #5382

@simaonogueira101

Description

@simaonogueira101

Summary

Add support for the wallet_connect RPC method (ERC-7846) when connecting with Base Account in the Ethers and Ethers5 adapters.

Background

Currently, the Ethers/Ethers5 adapters use eth_requestAccounts (EIP-1102) for all wallet connections, including Base Account. While this works, the Base Account SDK now supports the newer wallet_connect method which provides a better user experience.

Why wallet_connect?

Feature eth_requestAccounts wallet_connect
Standard EIP-1102 ERC-7846
User prompts 2 (connect + sign) 1 (combined)
SIWE support Separate step Built-in
Extensibility Limited Via ERC-5792 capabilities

From ERC-7846:

"By unifying connection and authentication into one step, apps can reduce friction, improve the user experience, and minimize redundant interactions."

Proposed Solution

Add special handling in EthersAdapter and Ethers5Adapter to use the wallet_connect method when connecting with Base Account:

const result = await provider.request({
  method: 'wallet_connect',
  params: [{
    version: '1',
    capabilities: {
      signInWithEthereum: {
        nonce,
        chainId: hexChainId
      }
    }
  }]
})

References

Additional Context

This is a non-breaking enhancement. The existing eth_requestAccounts flow continues to work for other wallets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions