-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
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
- ERC-7846: Wallet Connection API
- Base Account SDK Documentation
- Base Account
wallet_connectReference
Additional Context
This is a non-breaking enhancement. The existing eth_requestAccounts flow continues to work for other wallets.