A Rust-based service for monitoring ERC-20 token Transfer events on multiple blockchains and sending formatted notifications to a Telegram chat.
- Listens for ERC-20
Transferevents on multiple EVM-compatible blockchains (Ethereum, BSC, Viction, etc.) - Listen for SPL-token
Transferon Solana - Uses WebSocket RPC endpoints for real-time event streaming
- Sends detailed, clickable notifications to a Telegram chat, including:
- From/To addresses (with explorer links)
- Value (human-readable)
- Transaction hash (with explorer link)
- Configurable via
src/asset/config.json - Securely loads secrets from
src/asset/.env
Edit src/asset/config.json to add or update networks:
{
"BSC Mainnet": {
"name": "BSC Mainnet",
"chain_type": "evm",
"wss_urls": [
"wss://bsc-rpc.publicnode.com",
"wss://bsc.drpc.org"
],
"address": "",
"decimal": 18,
"explorer": "https://bscscan.com"
},
"VICTION": {
"name": "VICTION",
"chain_type": "evm",
"wss_urls": [
"wss://viction.drpc.org"
],
"address": "",
"decimal": 18,
"explorer": "https://vicscan.xyz"
},
"ETHEREUM": {
"name": "ETHEREUM",
"chain_type": "evm",
"wss_urls": [
"wss://0xrpc.io/eth",
"wss://ethereum-rpc.publicnode.com",
"wss://mainnet.gateway.tenderly.co"
],
"address": "",
"decimal": 18,
"explorer": "https://etherscan.io"
},
"SOLANA": {
"name": "SOLANA",
"chain_type": "solana",
"wss_url": "wss://api.mainnet-beta.solana.com",
"address": "",
"decimal": 6,
"explorer": "https://solscan.io"
}
}Adding Round-Robin RPC Support for Solana in src/asset/list_of_rpc.json
Create src/asset/.env:
TELEGRAM_BOT_KEY=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
- Install Rust (https://rustup.rs)
- Install dependencies:
cargo build
- Run the service:
cargo run
- For each configured network, a background task subscribes to Transfer events.
- When an event is detected, it is sent through a channel to a consumer task.
- The consumer formats the event and sends a message to the configured Telegram chat.
Transfer Event:
From: <a href="https://etherscan.io/address/0x...">0x...</a>
To: <a href="https://etherscan.io/address/0x...">0x...</a>
Value: 123.45
Transaction Hash: <a href="https://etherscan.io/tx/0x...">0x...</a>