/ src / utils / web3ModalSetup.ts
web3ModalSetup.ts
 1  import { createWeb3Modal, defaultWagmiConfig } from '@web3modal/wagmi/react'
 2  import { arbitrum, mainnet } from 'wagmi/chains'
 3  
 4  const projectId = '1874fe8ad6dc63fe3f91ca4e4a7ed1ba'
 5  
 6  if (!projectId) {
 7    console.error('STORYBOOK_WALLECTCONNECT_PROJECT_ID is not set');
 8  }
 9  
10  const metadata = {
11    name: 'Anki Karaoke',
12    description: 'Karaoke app with Web3 integration',
13    url: 'https://roc.box/', // Replace with your website
14    icons: ['https://roc.box/icon.png'] // Replace with your icon
15  }
16  
17  const chains = [mainnet, arbitrum] as const
18  
19  // Create wagmiConfig first
20  export const wagmiConfig = defaultWagmiConfig({
21    chains,
22    projectId,
23    metadata,
24  })
25  
26  // Then use wagmiConfig in createWeb3Modal
27  export const web3Modal = createWeb3Modal({
28    wagmiConfig,
29    projectId,
30  })