This project began as a task assigned to me. My curiosity led me to explore the possibilities, and I broke a lot of things in the process, to the point of suspecting my PC! Ultimately, I learned the strengths and weaknesses of using raw JSON-RPC, Wagmi, and Viem. While Wagmi is great for simple wallet connections and reading from the blockchain, its extensive feature set can make your code feel bulky. JSON-RPC can be a headache, and I wouldn't recommend it for complex applications.
To streamline my code, I created a custom hook that uses Wagmi for wallet and public actions, including event monitoring and reading from contracts (with the help of TanStack Query). For contract interactions that involve state changes, I used Viem, as it is a more lightweight and flexible alternative for that specific task.
- What I like most about this project:
- Seamless wallet connectivity with automatic network switching to where the contract was deployed.
- Real-time blockchain event monitoring (registrations, transfers, updates).
- A clean, responsive UI.
- State management with TanStack Query for an optimal user experience.
The beauty of Web3 development is in building transparent, user-centric applications that give users control over their digital identity.
Check out the code and the live demo!
Demo: nameservice.
Code: ens.
I'm always excited to discuss Web3 architecture and development patterns.
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.