1- import { GraphLogin , useGraphLogin } from '@graph-framework/identity' ;
2- import type { Signer } from '@graph-framework/identity/types' ;
1+ import { Identity } from '@graphprotocol/hypergraph' ;
32import { PrivyProvider , usePrivy , useWallets } from '@privy-io/react-auth' ;
43import { useRouter } from '@tanstack/react-router' ;
54import { useEffect , useState } from 'react' ;
65
76function DoGraphLogin ( ) {
8- const { login } = useGraphLogin ( ) ;
7+ const { login } = Identity . useGraphLogin ( ) ;
98 useEffect ( ( ) => {
109 console . log ( 'Logging in to The Graph' ) ;
1110 login ( ) ;
@@ -16,7 +15,7 @@ function DoGraphLogin() {
1615function Auth ( { children } : { children : React . ReactNode } ) {
1716 const { signMessage, authenticated } = usePrivy ( ) ;
1817 const { wallets } = useWallets ( ) ;
19- const [ signer , setSigner ] = useState < Signer | null > ( null ) ;
18+ const [ signer , setSigner ] = useState < Identity . Signer | null > ( null ) ;
2019
2120 useEffect ( ( ) => {
2221 const getSigner = async ( ) => {
@@ -43,10 +42,10 @@ function Auth({ children }: { children: React.ReactNode }) {
4342 return (
4443 < >
4544 { signer && authenticated ? (
46- < GraphLogin storage = { localStorage } signer = { signer } >
45+ < Identity . GraphLogin storage = { localStorage } signer = { signer } >
4746 < DoGraphLogin />
4847 { children }
49- </ GraphLogin >
48+ </ Identity . GraphLogin >
5049 ) : (
5150 children
5251 ) }
@@ -79,7 +78,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
7978
8079export function RequireAuth ( { children } : { children : React . ReactNode } ) {
8180 const { authenticated } = usePrivy ( ) ;
82- const { authenticated : graphAuthenticated } = useGraphLogin ( ) ;
81+ const { authenticated : graphAuthenticated } = Identity . useGraphLogin ( ) ;
8382 const router = useRouter ( ) ;
8483 if ( ! authenticated || ! graphAuthenticated ) {
8584 router . navigate ( {
0 commit comments