This Python script sets up a Telegram bot that allows users to fetch the latest transaction for a given wallet address on various blockchain networks (Ethereum, Binance Smart Chain, Polygon, Avalanche, Arbitrum, Optimism, and Fantom). The bot uses the respective blockchain explorers' APIs to retrieve the transaction data.
- Ethereum
- Binance Smart Chain
- Polygon
- Avalanche
- Arbitrum
- Optimism
- Fantom
- Python 3.7+
- Telegram Bot Token
- API keys from blockchain explorers
- Open Telegram and search for @BotFather
- Send
/newbot
command - Follow prompts to set:
- Bot name (display name)
- Bot username (must end in 'bot')
- BotFather will provide a token like:
123456789:ABCdefGHIjklmNOPQrstUVwxyz
- Keep this token secure - it provides full control of your bot
pip install python-telegram-bot aiohttp
- Create a Telegram bot via BotFather
- Obtain API keys from blockchain explorers:
- Update API keys in the script
- Start the bot:
python telegram-wallets-tracker-bot.py
- Telegram Commands:
/start
- Welcome message/tx <network> <address>
- Get latest transaction
Example:
/tx ethereum 0x742d35Cc6634C0532925a3b844Bc454e4438f44e
- Invalid network names
- Invalid addresses
- API rate limits
- Network connection issues
MIT