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.1.1.tar.gz (8.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.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fragment_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 8.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.1.1.tar.gz
Algorithm Hash digest
SHA256 edfe85a7a13e1e56fd13e112d8bd6e9af761845138784390c30fc2ba73b99f19
MD5 2c63a47c837fee6feb817091745e4ed2
BLAKE2b-256 9139faf4bb7c6a9873ab8ef1b5e88e55bb81d6b9b280ca463907cd8d2cf10e59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fragment_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8798fc126209d548fe750a6ad3d93a9afb84568e802da2fa9da5168706c9e446
MD5 caaf0342ce296327c30b835b452d129a
BLAKE2b-256 624fea1b1711e525e738b4b8cf2b4384aac499c9101dbc3495e428eaa7b47a81

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