# useWatch

## Function: useWatch()

> **useWatch**<`T`>(`hook`, `options`?): `WagmiHookReturnType`<`T`>

A custom hook that watches blockchain changes and triggers refetching logic based on specified criteria such as block number differences.

### Type Parameters

• **T** *extends* `object`

### Parameters

#### hook

`WagmiHookReturnType`<`T`>

The original hook provided by the Wagmi library with its data and methods.

#### options?

`UseWatchOptions`

Optional settings to configure the watching behavior, including whether to watch, block difference threshold, and chainId.

### Returns

`WagmiHookReturnType`<`T`>

Returns the original hook, preserving its functionality while adding watch-based refetching logic.

### Defined in

[packages/wagmi/src/hook/useWatch.tsx:46](https://github.com/haven1network/haven1-sdk/blob/df6267fec7b75040411529269f9c6a88e9c756ee/packages/wagmi/src/hook/useWatch.tsx#L46)


---

# 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://docs.haven1.org/build/developer-tools/haven1-sdk/haven1-wagmi-sdk/hook-module/usewatch.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.
