Skip to main content

eth_requestAccounts

MetaMask

Requests that the user provide an Ethereum address to be identified by. This method is specified by EIP-1102. Internally, this method calls wallet_requestPermissions for permission to call eth_accounts.

Params

(0)

Result

(AddressList)
array[string]
Match pattern:
^0x[0-9a-fA-F]{40}$

Errors

CodeMessage
4001User rejected the request.

Example

Request

await window.ethereum.request({
"method": "eth_requestAccounts",
"params": []
});

Result

"0xa77392123a1085f75e62eec7dea7e0e1e5142d5f"

Request

await window.ethereum.request({
"method": "eth_requestAccounts",
"params": []
});