https://github.com/thirdweb-example/wagmi-inapp-smart-wallets
Connect in-app smart wallets in a wagmi app
https://github.com/thirdweb-example/wagmi-inapp-smart-wallets
Last synced: 9 months ago
JSON representation
Connect in-app smart wallets in a wagmi app
- Host: GitHub
- URL: https://github.com/thirdweb-example/wagmi-inapp-smart-wallets
- Owner: thirdweb-example
- Created: 2024-12-13T06:37:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-16T20:57:10.000Z (12 months ago)
- Last Synced: 2025-02-16T21:29:14.691Z (12 months ago)
- Language: TypeScript
- Size: 107 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Thirdweb Wagmi Adapter
This is a demo of the [thirdweb Wagmi Adapter](https://github.com/thirdweb-dev/js/tree/main/packages/wagmi-adapter).
It demonstrates how to connect [in-app smart wallets](https://portal.thirdweb.com/connect/wallet/sign-in-methods/configure) 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.
```ts
// 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](https://thirdweb.com).
## How to run
```bash
pnpm install
pnpm dev
```