Skip to content

thinhbui95/tracking-transfer-token-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tracking-transfer-token-bot

A Rust-based service for monitoring ERC-20 token Transfer events on multiple blockchains and sending formatted notifications to a Telegram chat.

Features

  • Listens for ERC-20 Transfer events on multiple EVM-compatible blockchains (Ethereum, BSC, Viction, etc.)
  • Listen for SPL-token Transfer on 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

Configuration

1. Blockchain Config

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

2. Telegram Bot & Chat

Create src/asset/.env:

TELEGRAM_BOT_KEY=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

Usage

  1. Install Rust (https://rustup.rs)
  2. Install dependencies:
    cargo build
  3. Run the service:
    cargo run

How it works

  • 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.

Example Telegram Message

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>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages