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 fragmentpy

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 fragmentpy import FragmentClient
from fragmentpy.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.0.tar.gz (3.4 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.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fragment_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 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.0.tar.gz
Algorithm Hash digest
SHA256 61c84a7f5c3420a54e237808692ae242afea10be6dd730b607e09ed3b57e4958
MD5 9ab58900741f81f9e8556dbd9c321f11
BLAKE2b-256 6b8fccccd84d18127708d04ec3faf28777b4b4f0e9ef61b9c17a58d6ab6e8225

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fragment_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe646cf06a567ea12b00d68a09b5d19d74b58e07e21a5f9e5fda02b8ed935e7b
MD5 c752b777649de78c024a61e5418528dc
BLAKE2b-256 61fdd889697635c470b186dd99ec3fe3244d7f7b571a6063cbcf29510c89aa3a

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