@@ -9,6 +9,7 @@ import { AuthContextProvider } from './authContext';
9
9
import { web3AuthConnectorFactory } from "./config/web3AuthSettings" ;
10
10
import { polygonAmoy } from "wagmi/chains" ;
11
11
12
+ import { getConnectorClient } from '@wagmi/core'
12
13
/**
13
14
* AuthProvider is a higher-order component that wraps the application with necessary providers
14
15
* for state management, wallet connection, and Lens Protocol integration.
@@ -17,26 +18,50 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
17
18
18
19
const queryClient = new QueryClient ( ) ;
19
20
const [ web3Auth , web3AuthConnector ] = web3AuthConnectorFactory ( )
20
-
21
+
21
22
const wagmiConfig = createConfig ( {
22
23
syncConnectedChain : true ,
23
24
chains : [ polygonAmoy ] ,
24
25
connectors : [ web3AuthConnector ] ,
25
- transports : { [ polygonAmoy . id ] : http ( ) , }
26
+ transports : { [ polygonAmoy . id ] : http ( ) }
26
27
} )
27
28
28
29
const lensConfig : LensConfig = {
29
30
environment : development ,
30
31
bindings : bindings ( wagmiConfig ) ,
32
+ debug : true ,
33
+ storage : localStorage ,
34
+ logger : {
35
+ info ( message : string , data ?: unknown ) {
36
+ console . log ( message )
37
+ console . log ( data )
38
+ } ,
39
+ warn ( message : string , data ?: unknown ) {
40
+ console . log ( message )
41
+ console . log ( data )
42
+ } ,
43
+ error ( error : Error , message ?: string , data ?: unknown ) {
44
+ console . log ( message )
45
+ console . log ( data )
46
+ } ,
47
+ fatal ( error : Error , message ?: string , data ?: unknown ) {
48
+ console . log ( message )
49
+ console . log ( data )
50
+ }
51
+ }
31
52
} ;
32
53
54
+ ( async ( ) => (
55
+ console . log ( await getConnectorClient ( wagmiConfig ) )
56
+ ) ) ( )
57
+
33
58
return (
34
- < QueryClientProvider client = { queryClient } >
35
- < WagmiProvider config = { wagmiConfig } >
59
+ < WagmiProvider config = { wagmiConfig } >
60
+ < QueryClientProvider client = { queryClient } >
36
61
< LensProvider config = { lensConfig } >
37
62
< AuthContextProvider web3Auth = { web3Auth } > { children } </ AuthContextProvider >
38
63
</ LensProvider >
39
- </ WagmiProvider >
40
- </ QueryClientProvider >
64
+ </ QueryClientProvider >
65
+ </ WagmiProvider >
41
66
) ;
42
67
} ;
0 commit comments