Read contract state
Read onchain data from any contract on any chain.
Try out the demo for yourself in the reading contract state playground
Reading contract state in react is done via the useReadContract
hook. The hook returns a React Query data
, isLoading
, and other useful state that you can use to render your component.
Extensions are a way to make complex queries from a contract in a type-safe way with a simple API.
Check out all the available extensions for more details.
Query and listen to contract events with the useContractEvents
hook.
or with extensions:
Check out the contract hooks reference for more details.