Once your smart contracts are deployed on Vector Smart Chain (VSC), you need reliable frontend libraries to interact with them. VSC supports all Ethereum-compatible libraries, making it easy for developers to build responsive, wallet-connected dApps.
1. ethers.js
- Description: Lightweight and robust JavaScript library for interacting with Ethereum-compatible blockchains.
- Use Cases:
- Reading/writing contract state
- Signing and sending transactions
- Connecting wallets and managing providers
- Features:
- Supports JSON-RPC, WebSocket, and Alchemy endpoints
- Simple API with clear abstractions for contracts and providers
- Link: https://docs.ethers.org/
2. web3.js
- Description: Classic and widely-used JavaScript library for Ethereum-compatible networks.
- Use Cases:
- Full Web3 integration with wallets
- Smart contract interaction
- Subscription to blockchain events
- Features:
- Extensive support for events, filters, and transactions
- Works with almost all Ethereum-compatible nodes
- Link: https://web3js.readthedocs.io/
3. wagmi
- Description: React hooks library for connecting frontend dApps to wallets and contracts.
- Use Cases:
- Easily connect and manage wallet connections in React apps
- Handle account switching, network changes, and transactions
- Supports multiple wallet providers like MetaMask, WalletConnect, and more
- Features:
- Hooks-based API for modern React workflows
- Integrates seamlessly with ethers.js or viem
- Link: https://wagmi.sh
4. viem
- Description: Lightweight, modern TypeScript-first library for Ethereum-compatible chains.
- Use Cases:
- Minimal footprint frontend interactions
- Type-safe contract reads and writes
- Modern alternatives to web3.js/ethers.js in new projects
- Features:
- Fully modular and tree-shakeable
- Integrates well with React, Next.js, and other frameworks