> For the complete documentation index, see [llms.txt](https://city-protocol.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://city-protocol.gitbook.io/docs/software-development-kit/lending-borrowing/create-a-client.md).

# 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,
});
```
