Skip to main content

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 CodeMessageResolution
-32603User is missing idTokenCheck your network connection and try again
-32603Failed to create counterfactual addressCheck your network connection and try again
-32603Failed to refresh user detailsCheck your network connection and try again

Example

const addresses = await provider.request({ method: 'eth_requestAccounts' });
console.log(addresses); // ['0x...']

IMX Whitepaper IMX Tokenomics Block Explorer Careers Contact Us