Skip to main content
evmAdapter is the universal EVM adapter, exported directly from 0xtrails — no extra package needed. It accepts anything that implements the EIP-1193 provider interface: window.ethereum, embedded wallet providers, or providers produced by wallet SDKs. If a wallet library can hand you an object with a request({ method, params }) method, you can plug it into Trails with evmAdapter.

Quick start

The provider can be passed as the object itself, or as a (sync or async) function returning it — useful when the provider isn’t available at module load time.

Options

Wallet descriptor

The adapter subscribes to the provider’s accountsChanged, chainChanged, and disconnect events, so account and network switches in the wallet are reflected in Trails automatically. Chain switching uses wallet_switchEthereumChain, adding the chain via wallet_addEthereumChain when needed. Viem chain objects are compatible with this shape.

Host-owned wallets

When your app owns the wallet session — an embedded wallet, or a wallet SDK with its own connect UI — tell Trails to use the wallet without showing its own wallet-management surfaces:
This is exactly the pattern used to integrate wallet SDKs like thirdweb

Multiple wallets

Pass an array to offer several EIP-1193 wallets in the Trails connect UI: