# Constant Module

This directory contains the token and chain constants used in the Haven1 network. Each token and chain is represented by a TypeScript object that includes metadata such as the token's symbol, name, address, decimals, and icon, as well as the chain's ID, name, native currency, RPC URLs, and block explorers.

## Structure

The tokens and chains are organized into different environments:

* **Devnet**: Tokens and chains used in the development network.
* **Testnet**: Tokens and chains used in the testnet network.

## Token Definition

Each token is defined as a `Token` type, which includes the following properties:

* `symbol`: The symbol of the token (e.g., `hUSDC`).
* `name`: The full name of the token (e.g., `Haven1 USD Coin`).
* `icon`: The icon component for the token.
* `address`: The blockchain address of the token.
* `decimals`: The number of decimal places the token supports.

## Chain Definition

Each chain is defined as a `Chain` type, which includes the following properties:

* `id`: The unique identifier for the chain.
* `name`: The name of the chain.
* `nativeCurrency`: The native currency used on the chain.
* `rpcUrls`: The RPC URLs for connecting to the chain.
* `blockExplorers`: The block explorers for the chain.

## Usage Example

Here is an example of how to add the Haven1 Testnet chain to your Wagmi configuration:

```typescript
import { createClient, configureChains, WagmiConfig } from 'wagmi';
import { publicProvider } from 'wagmi/providers/public';
import { haven1Testnet } from '@haven1/wagmi-sdk/constant/chain';

const { chains, provider } = configureChains(
  [haven1Testnet],
  [publicProvider()]
);

const client = createClient({
  autoConnect: true,
  provider,
});

function App() {
  return (
    <WagmiConfig client={client}>
      {/* Your application components */}
    </WagmiConfig>
  );
}

export default App;
```

In this example, the `haven1Testnet` chain is imported from the `@haven1/wagmi-sdk` package and added to the Wagmi configuration using the `configureChains` function. The `WagmiConfig` component is then used to provide the configured client to your application.


---

# 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/constant-module.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.
