DEV Community

trdevlin
trdevlin

Posted on

Build a Multi-Chain Crypto Wallet Monitor in Node.js (15 minutes)

Want to watch your crypto wallets across Ethereum, Base, Polygon, Arbitrum, and Optimism without signing up for anything? Here's the shortest path.

The one dependency

npm install wallet-watcher
Enter fullscreen mode Exit fullscreen mode
const { getBalances } = require("wallet-watcher");
const balances = await getBalances("0xYourWallet");
// { eth: {symbol:"ETH", balance: 1.23}, base: {...}, polygon: {...}, ... }
Enter fullscreen mode Exit fullscreen mode

No Alchemy key, no Infura signup, no web3 SDK. Public RPCs, one call,
five chains (BTC addresses work too).

Turn it into a monitor

Wrap it in a loop, diff the result, and you have a watcher:

setInterval(async () => {
  const now = await getBalances(WALLET);
  for (const [chain, info] of Object.entries(now)) {
    if (prev[chain] && prev[chain].balance !== info.balance)
      console.log(`šŸ”” ${chain}: ${prev[chain].balance} → ${info.balance}`);
  }
  prev = now;
}, 5 * 60 * 1000);
Enter fullscreen mode Exit fullscreen mode

Turn it into a trading-bot base

I open-sourced a starter template that wires this into a clean loop with a
strategy file you own: crypto-bot-starter.
Edit strategy.js, plug in Telegram alerts, done.

When you actually need to swap

If you're moving between tokens, swapdeck.net is a
minimal no-signup swap UI for the same chains — connect and swap, no account.

Why this stack

Most tutorials start with "create an Alchemy account." For read-only balance monitoring, public RPCs are plenty — fewer keys in your .env, fewer things that can leak, faster setup. Keep the private keys for what actually needs them.

Top comments (0)