> For the complete documentation index, see [llms.txt](https://docs.haven1.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.haven1.org/build/developer-tools/haven1-sdk/haven1-wagmi-sdk.md).

# @haven1/wagmi-sdk

### Key Features

#### 1. **Chain Constants for Wagmi**

* Easily integrate the Haven1 blockchain into your project by using predefined chain constants in the Wagmi data type.
* Automatically configure the Haven1 chain in your Wagmi client setup without needing manual configuration.

#### 2. **Pre-Made React Hooks**

* **Connected Hooks**: Ready-to-use React hooks that connect to Haven1 smart contracts via Wagmi, making it easy to fetch user data, developer fees, and other blockchain-related information.
* **Smart Contract Integration**: Directly interact with Haven1 smart contracts, such as querying user information or retrieving developer fees, with minimal code.

#### 3. **Wagmi-Wrapped Hooks**

* Pre-configured hooks that combine multiple standard Wagmi hooks into one, reducing boilerplate code.
* These wrapped hooks offer more powerful functionalities, providing a higher level of abstraction while keeping things simple and efficient.

#### 4. **Blockchain Utilities**

* **BigNumber Utilities**: Includes helpful utilities for working with large numbers, such as BigNumber manipulation and formatting, essential for handling blockchain values like token balances and transaction amounts.
* Other useful functions for blockchain interactions, such as converting values, handling gas estimation, and more.

### Installation

Add the `@haven1/wagmi-sdk` package to your project:

{% tabs %}
{% tab title="npm" %}

```sh
npm install @haven1/wagmi-sdk
```

{% endtab %}

{% tab title="yarn" %}

```sh
yarn add @haven1/wagmi-sdk
```

{% endtab %}

{% tab title="pnpm" %}

```sh
pnpm add @haven1/wagmi-sdk
```

{% endtab %}
{% endtabs %}

### Namespaces

* DevnetToken
* TestnetToken

### Type Aliases

* AccountStatusId
* Token
* UseWatchOptions
* WagmiHookReturnType

### Variables

* ACCOUNT\_STATUS\_ID
* H1
* H1\_BLOCKTIME
* haven1Devnet
* haven1Testnet

### Functions

* AccountManager
* bigintFromDecimals
* bigIntMax
* formatBigint
* NativeAppFee
* ProofOfIdentity
* ProofOfIdentityV2
* useBalance
* useContractWrite
* useWatch


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.haven1.org/build/developer-tools/haven1-sdk/haven1-wagmi-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
