3

Is it possible to use the useContractRead hooks to get contract data without the user connecting their wallet? I see no option to do a read without a user connecting first in wagmi.

1 Answer 1

0

There is the possibility of using readContract from wagmi/core.

import { readContract } from '@wagmi/core'
 
const data = await readContract({
  address: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1',
  abi: wagmigotchiABI,
  functionName: 'getHunger',
})

See more: https://wagmi.sh/core/actions/readContract

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.