> 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
