-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exc 21 passport wallets examples (#2007)
- Loading branch information
1 parent
99398cb
commit c987a75
Showing
6 changed files
with
31 additions
and
43 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
12 changes: 12 additions & 0 deletions
12
examples/passport/wallets-with-nextjs/src/app/connect-with-wagmi/config.ts
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,12 @@ | ||
import { createConfig, http } from "wagmi"; | ||
import { immutableZkEvmTestnet } from "wagmi/chains"; | ||
import { injected } from "wagmi/connectors"; | ||
|
||
// create the Wagmi config for Immutable zkEVM Testnet | ||
export const config = createConfig({ | ||
chains: [immutableZkEvmTestnet], | ||
connectors: [injected()], | ||
transports: { | ||
[immutableZkEvmTestnet.id]: http(), | ||
}, | ||
}); |
11 changes: 11 additions & 0 deletions
11
examples/passport/wallets-with-nextjs/src/app/connect-with-wagmi/connect.tsx
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,11 @@ | ||
import { useAccount } from "wagmi" | ||
import { WalletOptions } from './wallet-options'; | ||
import { Account } from './account'; | ||
|
||
// show wallet options for login or the logged in account details | ||
// depending on whether the account is connected or not | ||
export function ConnectWallet() { | ||
const { isConnected } = useAccount() | ||
if (isConnected) return <Account /> | ||
return <WalletOptions /> | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
'use client'; | ||
|
||
export default function Home() { | ||
|
||
return (<> | ||
|