Wagmi Library
Wagmi
Wagmi is a React Hooks library for Ethereum. You can learn more about the rationale behind the project in the Why Wagmi section.
Installation
For new projects, it is recommended to set up your Wagmi app using the create-wagmi command line interface (CLI). This will create a new Wagmi project using TypeScript and install the required dependencies.
Once the command runs, you’ll see some prompts to complete.
Project name: wagmi-project
Select a framework: React / Vanilla
After the prompts, create-wagmi will create a directory with your project name and install the required dependencies.
5ireChain Configuration
For adding 5ireChain to the default code provided, we need to do some changes.
Inside the wagmi.ts
file, let’s add 5ireChain’s Thunder Testnet. You can find it in the Chain section of Wagmi official documentation.
-
Import thunderTestnet from the wagmi’s chains.
import { thunderTestnet} from 'wagmi/chains'
-
Add injected connector to the connectors
injected()
-
In the transports add
thunderTestnet
:[[thunderTestnet.id](http://thundertestnet.id/)]: http(),
The final code would look like:
Install the required dependencies
To install the required dependencies
Run the app in development mode
For running the app: