Skip to main content
Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
A pattern for using Voltaire with TanStack Query in React applications. This is our recommended approach instead of wagmi-like abstractions.
This Skill is typically used with another Skill like ethers-provider or viem-publicclient. The provider Skill handles blockchain communication; this Skill handles React state management.

Why Not wagmi?

wagmi is excellent, but it’s opinionated and includes features you may not need. This Skill shows how to build React hooks directly with TanStack Query:
  • Smaller bundle — Only include what you use
  • Full control — Customize caching, retries, and error handling
  • No lock-in — Standard TanStack Query patterns

Installation

Setup

Provider Setup

Hook Implementations

useBalance

useBlockNumber

useContractRead

useContractWrite

useWaitForTransaction

Usage Example

Customization Ideas

Add Optimistic Updates

Add Block-Based Refetching

Add Multicall Batching