Viem is one of the most popular libraries for interacting with EVM blockchains.
A PublicClient is an interface to “public” JSON-RPC API methods
such as retrieving block numbers, transactions, reading from smart contracts, etc.
We provide a helper method to allow you to create a Viem PublicClient given some network data.
Usage
Derive the public client from useGetActiveNetworkData, which automatically re-fetches when the wallet account changes or the user switches networks:
Last modified on September 21, 2026