This is a demo app that fetches and display all cryptocurrency token balances in a given wallet
Built with
- Next.js
create-next-app
.- pnpm
- tailwind
- shadcn
next/font
pnpm dev
Open http://localhost:3000 with your browser to see the result.
0x742d35cc6634c0532925a3b844bc454e4438f44e
0xfe9e8709d3215310075d67e3ed32a380ccf451c8
- used to simplify the logic in checking a balance for all the tokens but the underlying logic boils down to
for (let tokenAddress of tokenAddresses) {
const contract = new web3.eth.Contract(erc20AbiJson, tokenAddress);
const tokenBalance = await contract.methods.balanceOf(walletAddress).call();
// convert from wei to eth etc
}
- from chat gpt
Hostes on Vercel at crypto-wallet-demo-theta.vercel.app