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