Skip to main content

Function Signature

Description

Creates a viem public client for interacting with EVM blockchains. This client is used for read-only operations like getting balances, account information, and preparing transactions.

Parameters

Required Parameters

  • chain (Chain) - The viem chain configuration
  • rpcUrl (string) - The RPC URL for the blockchain network

Returns

  • PublicClient - A viem public client instance

Example

Common Use Cases

Get Account Balance

Prepare Transaction

Get Account Information

Error Handling

Last modified on January 26, 2026