Skip to main content

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.

Switches the active chain. The user confirms the switch in the popup.

Request

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

Parameters

params[0].chainId
`0x${string}`
required
Hex-encoded chain ID. Must be in appChainIds.

Returns

null on success.

Errors

CodeCause
4001User rejected the switch
4100Wallet not connected
4902Chain not in appChainIds
4200Method 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.