Addresses
When a user connects their wallet to your dapp, they're granting you access to one or more of their Ethereum accounts. What you receive is an array of addresses — and that array is the foundation of almost everything else you'll build. Every balance check, transaction, signature request, and permission grant flows from knowing who is on the other end of the connection.
The wallet exposes this through two JSON-RPC methods that return the same shape but behave differently: one silently reads what's already been approved, the other can prompt the user for access.
| Method | Prompt? | Typical use |
|---|---|---|
eth_accounts | No | Read addresses already shared with this origin |
eth_requestAccounts | Yes, if needed | Connect — prompt the user to share at least one account |
Order within the array is defined by the wallet.
eth_accounts
Reads addresses already shared with this origin — no prompt, no permission flow. Returns an empty array until the user has connected; returns the full list of granted addresses once they have.
RPC: eth_accounts → string[]
eth_requestAccounts
The standard connection trigger. Prompts the user if this origin hasn't been granted access yet, or returns immediately if it already has. Either way, the response is the same array of addresses the user approved.
RPC: eth_requestAccounts → string[]