Skip to main content

Unofficial Fragment SDK for purchasing Telegram goods (Stars, Premium, Ads)

Project description


📚 Introduction

Unofficial Python client for Fragment — buy Telegram goods (Stars, Premium, TON) via Fragment

⚠️ This library is not affiliated with Telegram or Fragment.
Use at your own risk.

🚀 Features

Currently, the library only supports one feature, as it is still under development. The remaining features will be implemented in the very next update.

  • Purchase Telegram Stars

  • Purchase Telegram Premium

  • Top up Telegram Ads (TON) balance

📦 Usage

pip3 install fragment-sdk

Before you start coding, make sure you have:

  • TON wallet (v4r2 or v5r1)
  • Fragment account with KYC. Auth cookies string
  • Tonapi.io API key

To get auth cookies use Cookie-Editor extension (Header string).

⭐ Purchase Stars example:

from fragment_sdk import FragmentClient
from fragment_sdk.wallet import WalletClient
import asyncio

async def main():
  wallet = WalletClient(
    tonapi_key="TONAPI_KEY",
    mnemonic="WORD1 WORD2 WORD3 ...",
    version='v5r1' # v5r1 by default (v4r2 supported)
  )
  fragment = FragmentClient(
    cookies="FRAGMENT_COOKIES_STRING", # Cookies in Header string format.
    wallet=wallet
  )
  
  response = await fragment.stars.buy_stars(username="whicencer", quantity=50)
  
  error = response.error
  tx_hash = response.data
  return tx_hash, error

asyncio.run(main())

💖 Support the Project

💎 TON Donations: UQCaKFm1d4CavB2aqZK1ypHFaAMIgpAz2D58hDyrT7RITfl2
🌟 Star the repo: it really helps others discover the library

Project details


Download files

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

Source Distribution

fragment_sdk-0.2.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

fragment_sdk-0.2.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file fragment_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: fragment_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for fragment_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a39ce956bbae6676386cbb7071034cff78cb4434986d21b5a48117dadd71070c
MD5 76bab07596d21fb518fa9f8fafde1d16
BLAKE2b-256 c192b0d5b5bc725d160ece88ccdf3315a3519e987caf906e5c6ca2bce442262d

See more details on using hashes here.

File details

Details for the file fragment_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fragment_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for fragment_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4614cb5c660b00e3ff044fa0cdfcedf3738467ee9fa7c02ef61dfa8b95e6795b
MD5 622d5da4d6ef9f3a6c8d40494931395a
BLAKE2b-256 6ec98db2bd17dcda0ad348295e8ae37843cdbb69fea2965afdb9399d0805f879

See more details on using hashes here.

Supported by

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