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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a39ce956bbae6676386cbb7071034cff78cb4434986d21b5a48117dadd71070c
|
|
| MD5 |
76bab07596d21fb518fa9f8fafde1d16
|
|
| BLAKE2b-256 |
c192b0d5b5bc725d160ece88ccdf3315a3519e987caf906e5c6ca2bce442262d
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4614cb5c660b00e3ff044fa0cdfcedf3738467ee9fa7c02ef61dfa8b95e6795b
|
|
| MD5 |
622d5da4d6ef9f3a6c8d40494931395a
|
|
| BLAKE2b-256 |
6ec98db2bd17dcda0ad348295e8ae37843cdbb69fea2965afdb9399d0805f879
|