Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

telegram-stars-rates

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telegram-stars-rates

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

pipPyPI
Version
1.0.0
Maintainers
1

⭐ 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

  • Fragment Analysis: Fetches real transactions from Fragment's TON address
  • Rate Calculation: Parses "X Telegram Stars" → TON transfers
  • USDT Conversion: Gets TON/USDT rate from Binance API
  • 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.

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

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

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

📜 Лицензия

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

🔗 Ссылки

📊 Статистика

GitHub stars GitHub forks PyPI downloads

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

Keywords

telegram

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts