# Create a Client

```llvm
bun add @cityprotocol/core viem
```

Unlike `CityClient` (which only needs a wallet client), `CityLendingClient` requires a Viem `publicClient` for on-chain reads alongside a `walletClient` for signing transactions. You also pass in the active `account` explicitly.

```
import { CityLendingClient } from "@cityprotocol/core";
import { createPublicClient, createWalletClient, custom, http } from "viem";
import { mainnet } from "viem/chains";

const publicClient = createPublicClient({
  chain: mainnet,
  transport: http(),
});

const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum),
});

const [account] = await walletClient.getAddresses();

const lendingClient = new CityLendingClient({
  publicClient,
  walletClient,
  account,
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://city-protocol.gitbook.io/docs/software-development-kit/lending-borrowing/create-a-client.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
