@@ -5,10 +5,9 @@ import { Button, Heading, Table, Link } from '@biom3/react';
55import NextLink from 'next/link' ;
66import { passportInstance } from '../utils/setupDefault' ;
77import { generateNonce } from 'siwe' ;
8- import { useConnect , useSignTypedData , useAccount , useDisconnect } from 'wagmi' ;
8+ import { useConnect , useSignTypedData } from 'wagmi' ;
99import { config } from '../utils/wagmiConfig' ;
10- import { injected , metaMask } from 'wagmi/connectors' ;
11- import { immutableZkEvmTestnet } from 'wagmi/chains' ;
10+ import { metaMask } from 'wagmi/connectors' ;
1211
1312export default function LinkExternalWallet ( ) {
1413 const [ isLoggedIn , setIsLoggedIn ] = useState < boolean > ( false ) ;
@@ -18,12 +17,12 @@ export default function LinkExternalWallet() {
1817 const [ isLinking , setIsLinking ] = useState < boolean > ( false ) ;
1918 const [ linkingStatus , setLinkingStatus ] = useState < string > ( '' ) ;
2019 const [ linkingError , setLinkingError ] = useState < string | null > ( null ) ;
21-
22- const { connectAsync, connectors } = useConnect ( {
20+ const [ linkedAddresses , setLinkedAddresses ] = useState < string [ ] > ( [ ] ) ;
21+
22+ const { connectAsync } = useConnect ( {
2323 config
2424 } ) ;
25- const connector = connectors [ 0 ] ;
26- const { disconnect } = useDisconnect ( ) ;
25+
2726 const { signTypedDataAsync } = useSignTypedData ( ) ;
2827
2928 const loginWithPassport = async ( ) => {
@@ -131,6 +130,8 @@ export default function LinkExternalWallet() {
131130 nonce
132131 } ) ;
133132
133+ const linkedAddresses = await passportInstance . getLinkedAddresses ( ) ;
134+ setLinkedAddresses ( linkedAddresses ) ;
134135 setLinkingStatus ( 'Wallet linked successfully!' ) ;
135136 setIsLinking ( false ) ;
136137 } catch ( error : any ) {
@@ -180,6 +181,12 @@ export default function LinkExternalWallet() {
180181 < Table . Cell > { linkingStatus } </ Table . Cell >
181182 </ Table . Row >
182183 ) }
184+ { linkedAddresses . length > 0 && (
185+ < Table . Row >
186+ < Table . Cell > < b > Linked Addresses</ b > </ Table . Cell >
187+ < Table . Cell > { linkedAddresses . join ( ', ' ) } </ Table . Cell >
188+ </ Table . Row >
189+ ) }
183190 { linkingError && (
184191 < Table . Row >
185192 < Table . Cell > < b > Error</ b > </ Table . Cell >
0 commit comments