Skip to main content

⭐ Telegram Stars Rates

PyPI version Python versions License: MIT

Real-time Telegram Stars to USDT exchange rates via Fragment blockchain analysis

🚀 Features

  • Real-time Exchange Rates: Get current Stars → USDT rates from Fragment blockchain
  • Minimalistic Library: Simple Python API with minimal dependencies
  • CLI Tool: Command-line interface for quick rate checks
  • Web Converter: GitHub Pages hosted converter with daily updates
  • Fragment Integration: Direct blockchain transaction parsing
  • Binance API: TON → USDT rates from Binance

📦 Installation

pip install telegram-stars-rates

💻 Usage

Python API

from telegram_stars_rates import get_stars_rate

# Get current exchange rates
result = get_stars_rate()
print(f"1 Star = ${result['usdt_per_star']:.6f} USDT")
print(f"1000 Stars = ${result['usdt_per_star'] * 1000:.2f} USDT")

# With raw transaction data
result = get_stars_rate(include_raw=True, limit=100)
print(f"Based on {result['fragment_raw']['transactions_count']} transactions")

CLI Tool

# Basic usage
telegram-stars-rates

# More transactions for better accuracy
telegram-stars-rates --limit 100

# JSON output
telegram-stars-rates --json

# With TON API key (faster, no rate limits)
telegram-stars-rates --api-key YOUR_TON_API_KEY

Web Interface

Visit the GitHub Pages site for an interactive converter:

  • Real-time rates updated daily
  • Convert between Stars ↔ USDT
  • Exchange rate statistics
  • Mobile-friendly interface

🔧 How It Works

  1. Fragment Analysis: Fetches real transactions from Fragment's TON address
  2. Rate Calculation: Parses "X Telegram Stars" → TON transfers
  3. USDT Conversion: Gets TON/USDT rate from Binance API
  4. Final Rate: Calculates Stars → USDT via Stars → TON → USDT

📊 API Reference

get_stars_rate(limit=50, include_raw=False, **kwargs)

Parameters:

  • limit (int): Number of transactions to analyze (default: 50)
  • include_raw (bool): Include raw transaction data (default: False)
  • api_key (str): TON API key for higher rate limits

Returns:

{
    "usdt_per_star": 0.012345,      # Main exchange rate
    "ton_per_star": 0.002500,       # Stars → TON rate  
    "usdt_per_ton": 4.938000,       # TON → USDT rate
    "timestamp": "2024-01-01T12:00:00Z",
    "errors": []                     # Any warnings/errors
}

🌍 GitHub Actions Integration

Automated daily updates for GitHub Pages:

- name: Update Exchange Rates
  run: |
    python scripts/generate_rates.py
    # Deploys to GitHub Pages automatically

🛠 Development

git clone https://github.com/username/telegram-stars-rates
cd telegram-stars-rates
pip install -e .

# Run tests
python -m pytest

# Generate web data
python scripts/generate_rates.py

📄 License

MIT License - see LICENSE file for details.

🔗 Links

🤝 Вклад в проект

Мы приветствуем вклад в развитие проекта!

  1. Форкните репозиторий
  2. Создайте ветку для вашей функции (git checkout -b feature/amazing-feature)
  3. Сделайте коммит (git commit -m 'Add amazing feature')
  4. Пушьте в ветку (git push origin feature/amazing-feature)
  5. Откройте Pull Request

📜 Лицензия

Этот проект распространяется под лицензией MIT. Подробности в файле LICENSE.

🔗 Ссылки

📊 Статистика

GitHub stars GitHub forks PyPI downloads


💎 Профессиональный анализ Telegram Stars курсов для Python разработчиков! 💎

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram_stars_rates-1.0.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telegram_stars_rates-1.0.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file telegram_stars_rates-1.0.0.tar.gz.

File metadata

  • Download URL: telegram_stars_rates-1.0.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for telegram_stars_rates-1.0.0.tar.gz
Algorithm Hash digest
SHA256 96bfe39fc23f4416801b0a33e6080af22f3bc33e7060e8807e25af351e01883f
MD5 dfb60402b548089dde3da374390690a8
BLAKE2b-256 0b5823e20aa19d059f010c0df10e060b80870fb94e7dfbffe25a172833641281

See more details on using hashes here.

File details

Details for the file telegram_stars_rates-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for telegram_stars_rates-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f962fe9dde0cb735fd916d7998320f4f945cf6a5e4892d7f440cfeb4986b2784
MD5 3402a82902bd6b0e1c8162fef32bc0de
BLAKE2b-256 6c39f18b32b97d8da17d27b43ee37410e8aad5ec1ef40f7013a67f50d8904395

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page