MetaMask
Restricted
eth_accounts
Summary: Gets a list of authorized addresses.
Returns a list of addresses that the user has authorized the dapp to access. This method requires calling
wallet_requestPermissions
for permission. We recommend using eth_requestAccounts
, which internally calls wallet_requestPermission
.
Parameters
This method doesn't accept any parameters.
Returns
Address list
arrayAn array of Ethereum addresses that the user has authorized the dapp to access.
Customize request
Parameter
Value
Connect your MetaMask wallet to run requests successfully.
Request
await window.ethereum.request({
"method": "eth_accounts",
"params": [],
});
Example response
[
"0xa77392123a1085f75e62eec7dea7e0e1e5142d5f"
]