Metadata-Version: 2.4
Name: fragment-api-sdk
Version: 0.1.0
Summary: Fragment API Python SDK — Telegram Stars & Premium with local signing (your seed never leaves your server)
Author: MBOX Community
License: MIT
Project-URL: Homepage, https://fragment.mboxcommunity.org
Project-URL: Documentation, https://fragment.mboxcommunity.org/docs.html
Project-URL: Repository, https://github.com/mboxcommunity/fragment-api
Keywords: telegram,fragment,stars,premium,ton
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Fragment API — Python SDK

Buy Telegram Stars and Premium through [Fragment API](https://fragment.mboxcommunity.org) with **local signing**: the service prepares each payment, this SDK verifies it against a pinned checklist and signs it on your machine. Your wallet seed never leaves your server.

## Install

```
pip install fragment-api-sdk
```

Requires Python 3.10+ and Node 18+ (used by the bundled TON signing helper).

## Usage

```python
from fragment_api_sdk import FragmentAPI

api = FragmentAPI(
    api_key="mfrag_…",                       # issued by the service admin
    cookies={"stel_ssid": "…", "stel_dt": "…", "stel_token": "…"},  # your Fragment session
    seed="word1 word2 … word24",             # used ONLY locally — never transmitted
    max_ton_per_order=5_000_000_000,         # mandatory spend limit (nanotons)
)

order = api.buy_stars("@durov", 100)         # verify → sign locally → submit
print(order["status"])                       # success

order = api.buy_premium("@durov", 12)        # 3 | 6 | 12 months
```

Spend limits are mandatory — the SDK refuses to operate without them, and refuses to sign any payment that fails verification (order mismatch, unpinned destination, fee above cap, expired payment).

Full documentation: https://fragment.mboxcommunity.org/docs.html
