> ## 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. The user confirms the switch in the popup.

## Request

```ts theme={null}
await provider.request({
  method: 'wallet_switchEthereumChain',
  params: [{ chainId: '0x79a' }], // 1946 Soneium Minato
})
```

## Parameters

<ParamField path="params[0].chainId" type="`0x${string}`" required>
  Hex-encoded chain ID. Must be in `appChainIds`.
</ParamField>

## Returns

`null` on success.

## Errors

| Code   | Cause                                                 |
| ------ | ----------------------------------------------------- |
| `4001` | User rejected the switch                              |
| `4100` | Wallet not connected                                  |
| `4902` | Chain not in `appChainIds`                            |
| `4200` | Method unsupported (Mini App context only, see below) |

## Mini App constraint

Inside a Mini App, the SDK forwards `wallet_switchEthereumChain` normally, but the host iframe may reject it. Mini Apps inherit the active chain from the Startale App host; the host controls whether a switch is permitted. Treat a `4200` response in a Mini App context as a host-enforced restriction, not an SDK limitation.

## Related

* [Networks](/concepts/networks)
* [Wallet integration](/miniapps/wallet-integration), Mini App constraints.
