eth_requestAccounts
Prompts the user to authenticate with 1auth and authorize their passkey account for your dApp. If the user has not authenticated before, this opens the normal passkey registration/login flow. It does not offer external-wallet selection; use wallet_connect only when your interface intentionally offers a passkey-or-external-wallet choice.
Try it
Parameters
None.
Returns
string[] - Array of account addresses that the user has authorized.
Example
try {
const accounts = await provider.request({ method: 'eth_requestAccounts' });
console.log('Connected as:', accounts[0]);
} catch (error) {
if (error.message.includes('cancelled')) {
console.log('User cancelled the connection');
}
}Behavior
- If the user is already connected, returns the stored passkey account immediately
- Otherwise, opens the normal 1auth passkey registration/login flow
- The user can approve or cancel the authentication request
Notes
- Use
eth_requestAccountsfor the normal 1auth passkey authentication flow - This method does not expose external-wallet selection
eth_accountsis passive: it reports currently authorized accounts without opening authentication or connection UI- The returned address is the user's smart account address