Skip to main content
The Trails Widget is not tied to any particular wallet library. The SDK talks to wallets through adapters: small factories that bridge an existing wallet runtime (wagmi, an EIP-1193 provider, a Solana wallet, an embedded wallet SDK) into the Trails widget. Omit adapters entirely and Trails uses its built-in EVM wallet runtime, your app wallet context stays separate. Pass adapters when your app already owns wallet state and Trails should share it instead of managing its own.

Available adapters

Wallet SDKs that can produce an EIP-1193 provider don’t need a dedicated adapter — they plug into evmAdapter directly. See the thirdweb guide for a complete example of this pattern.

Where to pass adapters

Adapters are a widget-only feature. Pass them on focused widget components such as Pay, Fund, Swap, Earn, Withdraw.

Mixing adapters

You can pass several adapters together. EVM adapters compose into one wallet runtime; Solana adapters stack alongside, so EVM and Solana wallets work in the same widget:

Buffer polyfill for Tron

tronAdapter pulls in TronWeb, which reads the Node Buffer global while its modules evaluate. Browsers don’t define Buffer, so without a polyfill the import throws ReferenceError: Buffer is not defined and takes down the surrounding React tree — typically a blank page rather than a caught error. Install the buffer package and assign the global before anything imports the adapter:
Import it as the first import of the entry that loads tronAdapter:
Import order matters — the assignment has to run before TronWeb’s modules evaluate, so keep it above the adapter import. Bundlers that hoist or split entries can reorder this; if the error persists, inject the global at build time instead (for example Vite’s define, or webpack.ProvidePlugin). svmAdapter does not need this — Solana support runs in the browser without a Buffer global.

Choosing an adapter

  1. No existing wallet stack? Pass no adapters — the built-in runtime handles injected wallets and WalletConnect.
  2. App on wagmi? Use wagmiAdapter. One package supports wagmi 2 and wagmi 3. Wagmi-based wallet SDKs such as Dynamic (Fireblocks embedded wallets) plug in the same way — no custom Trails code needed.
  3. Embedded or custom wallet that speaks EIP-1193? Use evmAdapter. This covers wallet SDKs that expose an EIP-1193 provider directly, such as thirdweb.
  4. Solana? Add svmAdapter.
  5. Tron? Add tronAdapter, plus the Buffer polyfill.