EIP1193.toProvider, which plugs straight into Trails’s built-in evmAdapter.
The division of labor:
- thirdweb owns the wallet: connection UI (
ConnectButton), session persistence, social login, smart accounts. - Trails owns the payment: routing, quotes, and cross-chain execution, signed through the provider it was handed.
Install
1. Create the thirdweb client
2. Bridge the active thirdweb wallet to a Trails adapter
This hook is the entire integration. It reads the live wallet state with thirdweb’s hooks, converts the wallet to EIP-1193, and wraps it withevmAdapter:
showDisconnect: falseandsupportsWalletSelection: falsemark the wallet as host-owned: Trails uses it for signing but never shows its own connect, disconnect, or wallet-picker UI — thirdweb’sConnectButtonowns that lifecycle.- The
useMemodependencies mean the adapter rebuilds whenever the user switches accounts or chains in thirdweb, so Trails always tracks the live wallet.
3. Wire it up
thirdweb handles connection; the widget renders once a wallet is active:The pattern generalizes
Nothing here is thirdweb-specific from Trails’s point of view: any wallet SDK that can expose an EIP-1193 provider integrates the same way — convert to a provider, wrap withevmAdapter, mark it host-owned. See the EIP-1193 adapter page for the full evmAdapter API.