Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

add wagmi util #526

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion template/web/src/store/createWagmiConfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createConfig, http } from 'wagmi';
import { base, baseSepolia } from 'wagmi/chains';
import { coinbaseWallet } from 'wagmi/connectors';
import { injected, metaMask, safe, walletConnect, coinbaseWallet } from 'wagmi/connectors';
import { WALLET_CONNECT_PROJECT_ID } from '@/utils/wagmi';

export function createWagmiConfig(rpcUrl: string, projectId?: string) {
// Keep this till we fully deprecated RK inside the template
Expand All @@ -19,6 +20,12 @@ export function createWagmiConfig(rpcUrl: string, projectId?: string) {
appName: 'buildonchainapps',
preference: 'smartWalletOnly',
}),
injected(),
walletConnect({
projectId: WALLET_CONNECT_PROJECT_ID
}),
// metaMask(),
safe(),
],
ssr: true,
transports: {
Expand Down
3 changes: 3 additions & 0 deletions template/web/src/utils/wagmi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import isClient from './isClient';

export const WALLET_CONNECT_PROJECT_ID = process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID ?? '';