We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When calling the getAvailable function in my hook:
import { getAvailable } from '@ensdomains/ensjs/public' import useEnsClient from '@hooks/ensJs/client' import { useMountedAccount } from '@justaname.id/react' import { useQuery } from '@tanstack/react-query' export const buildIsEnsAvailableKey = ( ens: string, chainId: number | undefined, ) => ['IS_ENS_AVAILABLE_KEY', ens, chainId] export const getIsEnsAvailable = async (ens: string, ensClient: any) => await getAvailable(ensClient, { name: ens }) export const useIsEnsAvailable = (ens: string) => { const { chainId } = useMountedAccount() const ensClient = useEnsClient() const query = useQuery({ queryKey: buildIsEnsAvailableKey(ens, chainId), queryFn: () => getIsEnsAvailable(ens, ensClient), enabled: ens.length > 4, }) return { isEnsAvailableLoading: query.isLoading, isAvailable: query.data, } }
When trying to check if 😠️.eth is available, its returning true.
Im using the ^4.0.0 version of ensJs
This is how the ensClient is created:
import { http } from 'viem' import { mainnet, sepolia } from 'viem/chains' import { createEnsPublicClient } from '@ensdomains/ensjs' import { useMountedAccount } from '@hooks'; const useEnsClient = () => { const { chainId } = useMountedAccount(); const chain = chainId === 1 ? mainnet : sepolia; const ensClient = createEnsPublicClient({ chain, transport: http(), }); return ensClient; }; export default useEnsClient;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When calling the getAvailable function in my hook:
When trying to check if 😠️.eth is available, its returning true.
Im using the ^4.0.0 version of ensJs
This is how the ensClient is created:
The text was updated successfully, but these errors were encountered: