Coinbase Wallet SDK
eth_accounts
Returns a list of addresses owned by the connected wallet without prompting user authorization
Defined in EIP-1474
Returns a list of addresses owned by the connected wallet. Unlike eth_requestAccounts
, this method returns an empty array if no accounts are available or if the user has not authorized any accounts to the caller. This method does not prompt the user to approve connection.
Parameters
This method does not accept any parameters.
Returns
An array of Ethereum addresses (hexadecimal strings), which the connected user controls. The array will typically contain a single address, which is the currently selected account in the wallet. If the wallet is not connected or no accounts are authorized, this method returns an empty array.
Error Handling
Code | Message | Description |
---|---|---|
4100 | Requested method not supported | The provider does not support the eth_accounts method |
4900 | Disconnected | The provider is disconnected from the wallet |