-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
515 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use client"; | ||
|
||
import { createWeb3Modal, defaultWagmiConfig } from '@web3modal/wagmi/react' | ||
|
||
import { WagmiConfig } from 'wagmi' | ||
import { arbitrum, mainnet, hardhat } from 'viem/chains' | ||
|
||
// 1. Get projectId | ||
const projectId = '87b19285bd7e81f2a2dc76728f6eb331' | ||
|
||
// 2. Create wagmiConfig | ||
const metadata = { | ||
name: 'Web3Modal', | ||
description: 'Web3Modal Example', | ||
url: 'https://web3modal.com', | ||
icons: ['https://avatars.githubusercontent.com/u/37784886'] | ||
} | ||
|
||
const chains = [mainnet, arbitrum, hardhat] | ||
const wagmiConfig = defaultWagmiConfig({ chains, projectId, metadata }) | ||
|
||
// 3. Create modal | ||
createWeb3Modal({ wagmiConfig, projectId, chains }) | ||
|
||
export function Web3Modal({ children }) { | ||
return <WagmiConfig config={wagmiConfig}>{children}</WagmiConfig>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.