Integrating WalletConnect with Next.js Project on Conflux eSpace
This tutorial provides a comprehensive guide on how to integrate WalletConnect with Web3Modal in a Next.js project, specifically targeting the Conflux eSpace network. For a hands-on example, check out the GitHub repository web3modal-conflux-nextjs.
前提条件
- Node.js installed on your system
- Basic knowledge of React and Next.js
- An account on the Conflux eSpace network
Step 1: Set Up Your Next.js Project
First, create a new Next.js application if you haven't already:
npx create-next-app web3modal-conflux-nextjs
cd web3modal-conflux-nextjs
When setting up your Next.js project using create-next-app
, you'll be prompted with a few configuration options. For the purposes of this tutorial, you can proceed with all the default settings provided by the setup. This will configure your project with optimal defaults for most applications, including a basic file structure and configuration settings.
Step 2: Install Necessary Packages
Web3Modal SDK has support for Wagmi, which will help you interact with wallets and smart contracts.
npm install @web3modal/wagmi wagmi viem @tanstack/react-query