> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://www.openfort.io/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

# eth\_requestAccounts

Requests access to Account addresses.

:::info
The `eth_requestAccounts` methods effectively "connects" an Application to a Wallet.
:::

Call it from a user gesture, such as a **Connect** button, because the Wallet opens its authentication screen (the `/sign/eth-request-accounts` [route of the Wallet UI](https://www.openfort.io/docs/products/cross-app-wallet/setup/react/wallet-ui#wallet-routes)) so the user can sign in and approve the connection.

It is also the handshake the rest of the provider depends on. The Ecosystem SDK provider rejects every other documented method except `eth_chainId` and `wallet_sendCalls` with `4100` until `eth_requestAccounts` has resolved once. After it resolves, the provider stores the addresses and emits `connect` with the current chain ID together with `accountsChanged`, so [`eth_accounts`](https://www.openfort.io/docs/products/cross-app-wallet/rpc/eth_accounts) returns the same list without prompting the user again.

## Request

```ts
type Request = {
  method: "eth_requestAccounts";
};
```

### Parameters

`eth_requestAccounts` takes no parameters.

## Response

Array of connected Account addresses. The first entry is the account the Wallet signs with.

```ts
type Response = `0x${string}`[];
```

```json
["0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"]
```

## Example

An interactive demo, runnable on this page.

:::warning
To make these instructions concrete, we have created a sample cross-app wallet called **Rapidfire ID**. To interact with it, you can find its SDK in the NPM package directory: [@rapidfire/id](https://www.npmjs.com/package/@rapidfire/id).

You can check out the GitHub [repository for Rapidfire Wallet](https://github.com/openfort-xyz/ecosystem-sample) to learn how to create your own wallet.
:::

```ts
import RapidfireID from "@rapidfire/id";

const rapidfire = new RapidfireID();
const provider = rapidfire.getEthereumProvider();

const accounts = await provider.request({ method: "eth_requestAccounts" });// [!code focus]
```

## Errors

| Code   | Meaning                   | When it happens                                                                        |
| ------ | ------------------------- | -------------------------------------------------------------------------------------- |
| `4001` | User rejected the request | The user closes the Wallet window or declines the connection.                            |
| `4100` | Unauthorized              | Another method is called before `eth_requestAccounts` has connected the Application.     |

Both codes are defined by [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193). Treat `4001` as a normal outcome and leave the user on the disconnected state rather than retrying automatically.

## Related

* [`eth_accounts`](https://www.openfort.io/docs/products/cross-app-wallet/rpc/eth_accounts) reads the connected addresses without opening the Wallet.
* [`wallet_getCapabilities`](https://www.openfort.io/docs/products/cross-app-wallet/rpc/wallet_getCapabilities) reports what the Wallet supports on each chain once connected.
* [Wagmi setup for cross-app wallets](https://www.openfort.io/docs/products/cross-app-wallet/usage/web-app-wagmi) wires the connection into a React app.
