# @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: 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.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.
