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

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