> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Client

## Overview

The **Client** combines the three pieces that every interaction needs:

* **[Chain](/docs/chains)**: chain config and RPC-to-native codecs.
* **[Transport](/docs/transports)**: the wire that carries JSON-RPC requests.
* **[Account](/docs/accounts)** (optional): the Account that Actions requiring one default to.

[`Client.create`](/docs/clients/create) constructs one Client.
[`Client.createResolver`](/docs/clients/resolve) constructs typed Clients on demand for configured
Chains.

A base Client exposes a typed [`request`](/docs/clients/create) function and its resolved Chain,
Account, and Transport.

Use [`.extend()`](/docs/clients/create#extending-a-client) to attach Actions. The Client only includes
the behavior that you add.

[`Client.fromV2`](/docs/clients/v2-adapters#clientfromv2) and [`Client.toV2`](/docs/clients/v2-adapters#clienttov2) adapt base Clients between Viem v2 and v3 during an incremental migration.

```ts twoslash
import { Client, http } from 'viem'
import { mainnet } from 'viem/chains'

const client = Client.create({
  chain: mainnet,
  transport: http(),
})
```

<Cards>
  <Card title="Creating a Client" description="Compose a chain, transport, and account with Client.create, then extend it." icon="lucide:hammer" to="/docs/clients/create" />

  <Card title="Resolving Clients" description="Resolve a typed Client for each configured chain." icon="lucide:route" to="/docs/clients/resolve" />

  <Card title="Adapting v2 Clients" description="Reuse request connectivity across Viem v2 and v3 Clients." icon="lucide:repeat-2" to="/docs/clients/v2-adapters" />

  <Card title="Overriding Actions" description="Intercept nested Actions with Client extensions." icon="lucide:replace" to="/docs/clients/override" />
</Cards>
