> ## Documentation Index
> Fetch the complete documentation index at: https://docs.startale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# wallet_switchEthereumChain

> Switch the wallet's active chain.

Switches the active chain.

## Request

```ts theme={null}
await provider.request({
  method: 'wallet_switchEthereumChain',
  params: [{ chainId: '0x1' }], // Ethereum Mainnet
})
```

## Parameters

**params\[0].chainId** `0x$\{string\}` *required*

Hex-encoded chain ID of a network the Startale App serves: `0x74c` for Soneium Mainnet or `0x1` for Ethereum Mainnet. Inside a Mini App, it must be a chain your Mini App is enabled for.

## Returns

`null` on success. The provider emits `chainChanged` with the new chain ID.

## Behavior

In a standalone application, the switch happens in the SDK, without a popup, once the user is connected. A chain the Startale App does not serve opens the Startale App, which rejects it.

Inside a Mini App, the host switches only to a chain your Mini App is enabled for, which is Soneium Mainnet only by default. See [Mini App chains](https://docs.startale.com/miniapps/wallet-integration.md#chains).

## Errors

| Code | Cause |
| - | - |
| `4100` | Wallet not connected (standalone applications) |
| `4001` | The chain is not served by the Startale App (standalone applications). The Startale App shows the request as not supported, and closing it rejects the request. |
| `4200` | The chain is not enabled for your Mini App (Mini Apps) |

## Related

* [Networks](https://docs.startale.com/concepts/networks.md)
* [Wallet integration](https://docs.startale.com/miniapps/wallet-integration.md), Mini App constraints.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.