eth_accounts
Returns a list of addresses owned by client.
Parameters
None
Returns
An array of hexadecimals as strings representing the addresses owned by the client.
Infura will not return any accounts
While this JSON-RPC method is supported by Infura, it will not return any accounts as Infura does not support "unlocking" accounts. Instead, users should send pre-signed raw transactions using eth_sendRawTransaction
.
Example
Replace <YOUR-API-KEY>
with an API key from your MetaMask Developer dashboard.
Request
- curl
- WSS
curl https://scroll-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}'
wscat -c wss://scroll-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1}'
Response
- JSON
{
"jsonrpc": "2.0",
"id": 1,
"result": []
}