Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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

  1. If the user is already connected, returns the stored passkey account immediately
  2. Otherwise, opens the normal 1auth passkey registration/login flow
  3. The user can approve or cancel the authentication request

Notes

  • Use eth_requestAccounts for the normal 1auth passkey authentication flow
  • This method does not expose external-wallet selection
  • eth_accounts is passive: it reports currently authorized accounts without opening authentication or connection UI
  • The returned address is the user's smart account address