> For the complete documentation index, see [llms.txt](https://nazeehs-org.gitbook.io/comp-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nazeehs-org.gitbook.io/comp-kit/clients/wallet-client.md).

# Wallet Client

A Wallet Client is an interface provided by [viem](https://viem.sh/) to interact with [Ethereum Account(s)](https://ethereum.org/en/glossary/#account) and provides the ability to retrieve accounts, execute transactions, sign messages, etc through [Wallet Actions](https://viem.sh/docs/actions/wallet/introduction.html).

You can read more about Wallet Client [here](https://viem.sh/docs/clients/wallet.html).

In the `comp-kit` library, you're provided with the `useWalletClient` hook that you can use in any file of your dapp.

## Usage

In order to use `walletClient`, import `useWalletClient` from `"@nazeeh2000/comp-kit"`. The return value of this hook will be `walletClient` that you can use in any part of your dapp.

You can use `walletClient` in your component as per the below example.

```tsx
'use client'
import { useWalletClient } from "@nazeeh2000/comp-kit";

export default function Home() {
    const walletClient = useWalletClient();

    return (
    // Your component
    )
}
```

You can apply all the methods to the `walletClient` that are applicable to the `walletClient` of `viem` mentioned [here](https://viem.sh/docs/clients/wallet.html).

> Note: You need to add `use client` at the top of the component accessing these hooks as these hooks cant be run on server side because they've *React Context* in the background.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://nazeehs-org.gitbook.io/comp-kit/clients/wallet-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.
