Skip to content

thirdweb-example/wagmi-inapp-smart-wallets

Repository files navigation

Thirdweb Wagmi Adapter

This is a demo of the thirdweb Wagmi Adapter.

It demonstrates how to connect in-app smart wallets to a Wagmi app.

Users connect with google, and obtain a ERC-4337 smart account that can be used to interact with the app without paying for gas.

// src/wagmi.ts
export const config = createConfig({
  chains: [chain],
  connectors: [
    inAppWalletConnector({
      client,
      smartAccount: {
        chain: thirdwebChain(chain),
        sponsorGas: true,
      },
    }),
  ],
  transports: {
    [chain.id]: http(),
  },
});

Prerequisites

Copy the .env.example file to .env and set your Thirdweb client ID. You can get your client ID from the thirdweb dashboard.

How to run

pnpm install
pnpm dev

About

Connect in-app smart wallets in a wagmi app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published