eth_requestAccounts
This method attempts to authenticate the user and initialises their Passport wallet before returning an array of wallet addresses. If the user does not already have an active session with Passport, then they will be prompted to log in.
Params
This method does not accept any parameters.
Result
Returns a Promise that resolves with a string array containing the users Passport wallet address.
Method Specific Errors
Error Code | Message | Resolution |
---|---|---|
-32603 | User is missing idToken | Check your network connection and try again |
-32603 | Failed to create counterfactual address | Check your network connection and try again |
-32603 | Failed to refresh user details | Check your network connection and try again |
Example
const addresses = await provider.request({ method: 'eth_requestAccounts' });
console.log(addresses); // ['0x...']