Nexus is a web application built with Next.js and integrates with Blockchain using ethers.js. It allows users to:
- Select input and output tokens
- Enter the amount of input tokens to swap
- See the estimated amount of output tokens received (based on current market prices)
- Initiate a swap transaction (requires a connected wallet)
- Supports multiple input tokens
- Fetches price data from a liquidity pool contract
- Provides a user-friendly interface for selecting tokens and entering amounts
- Integrates with a wallet connector for signing transactions
This component relies on several external libraries:
react
next
antd
(for UI components)@ant-design/icons
(for icons)wagmi
(for wallet connection)ethers
(for interacting with Ethereum blockchain)react-toastify
(for displaying notifications)next/image
(for displaying token logos)bignumber.js
(for handling large numbers)
- Clone the repository:
git clone https://github.com/anstormx/nexus.git
- Install the required dependencies:
npm i
- Build and start the project:
npm run build
npm run start
tokenList
: An array of objects containing token information (name, symbol, logoURI, address, decimals)SwapV1
: The address of the swap contract (if using a custom contract)liquidity
: The address and ABI of the liquidity pool contractv3pool
: The ABI of the V3 pool contractdai, link usdc, weth
: The ABI and address of minted ERC20 tokens