Skip to main content
@0xtrails/adapter-wagmi lets Trails use the wagmi setup your app already has. Use it when your app owns WagmiProvider, chains, transports, and connectors, and you want the Trails widget to share that wallet state. A single package covers both major wagmi versions: wagmi@^2.19.0 || ^3.2.0. Wagmi-based stacks such as Dynamic (Fireblocks embedded wallets), Privy, and Sequence Connect work through this adapter too.

Install

Quick start

The adapter auto-detects a surrounding WagmiProvider

Options

Custom wallet descriptors

Pass wallets when runtime connector inference isn’t enough — to control how a wallet appears in Trails, or to wire a custom connect flow:
Descriptors can also carry a connect: () => Promise<void> callback that Trails invokes when the user picks that wallet — this is how embedded-wallet login flows are wired in (see the Privy example below).

Embedded wallets (Privy)

Privy exposes its embedded wallet through @privy-io/wagmi, so it works with this adapter. Build the wagmi config with Privy’s createConfig, then describe the embedded wallet with a custom connect action that triggers Privy’s login:
When the user selects “Privy Embedded” in the Trails connect UI, Trails calls your connect callback, Privy runs its login flow, and the resulting wagmi session is picked up automatically.

Sequence Connect

When wrapping the app in <SequenceConnect>, pass the host-owned Sequence hooks so the adapter can expose Sequence’s connect modal and WaaS fee options inside the widget: