mirror of
https://github.com/vibe-existing/pyfragment.git
synced 2026-07-25 06:54:31 +00:00
Refactor FragmentAPI to pyfragment
- Renamed the package from `fragmentapi` to `pyfragment` across all modules and tests. - Removed the old wallet utility functions and replaced them with new implementations. - Updated the `pyproject.toml` to reflect the new package name and repository links. - Adjusted all import statements in tests to use the new package name. - Implemented new methods for gifting Telegram Premium, Stars, and topping up TON balance. - Added exception handling for various error scenarios in the API interactions. - Created new utility functions for handling HTTP requests and decoding payloads. - Established a clear structure for types and constants used throughout the library.
This commit is contained in:
@@ -7,14 +7,14 @@
|
||||
<b>Python library for the Fragment.com API — gift Telegram Stars, Premium, and top up TON Ads balance.</b>
|
||||
</p>
|
||||
|
||||
[](https://pypi.org/project/fragmentapi/)
|
||||
[](https://pypi.org/project/fragmentapi/)
|
||||
[](https://pypi.org/project/pyfragment/)
|
||||
[](https://pypi.org/project/pyfragment/)
|
||||
[](https://python.org)
|
||||
[](LICENSE)
|
||||
[](https://github.com/bohd4nx/FragmentAPI/stargazers)
|
||||
[](https://github.com/bohd4nx/FragmentAPI/actions)
|
||||
[](LICENSE)
|
||||
[](https://github.com/bohd4nx/pyfragment/stargazers)
|
||||
[](https://github.com/bohd4nx/pyfragment/actions)
|
||||
|
||||
[Report Bug](https://github.com/bohd4nx/FragmentAPI/issues) · [Request Feature](https://github.com/bohd4nx/FragmentAPI/issues) · [**Donate TON**](https://app.tonkeeper.com/transfer/UQCppfw5DxWgdVHf3zkmZS8k1mt9oAUYxQLwq2fz3nhO8No5)
|
||||
[Report Bug](https://github.com/bohd4nx/pyfragment/issues) · [Request Feature](https://github.com/bohd4nx/pyfragment/issues) · [**Donate TON**](https://app.tonkeeper.com/transfer/UQCppfw5DxWgdVHf3zkmZS8k1mt9oAUYxQLwq2fz3nhO8No5)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
## 📦 Installation
|
||||
|
||||
```bash
|
||||
pip install fragmentapi
|
||||
pip install pyfragment
|
||||
```
|
||||
|
||||
Requires **Python 3.12+**.
|
||||
@@ -44,7 +44,7 @@ Requires **Python 3.12+**.
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
from fragmentapi import FragmentClient
|
||||
from pyfragment import FragmentClient
|
||||
|
||||
client = FragmentClient(
|
||||
seed="word1 word2 ... word24",
|
||||
@@ -146,10 +146,10 @@ Go to **Settings → Backup** → copy the 24 words.
|
||||
|
||||
## 🗂️ Error Handling
|
||||
|
||||
All exceptions inherit from `FragmentError` — see [`fragmentapi/types/exceptions.py`](fragmentapi/types/exceptions.py) for the full list.
|
||||
All exceptions inherit from `FragmentError` — see [`pyfragment/types/exceptions.py`](pyfragment/types/exceptions.py) for the full list.
|
||||
|
||||
```python
|
||||
from fragmentapi import FragmentClient, UserNotFoundError, ConfigurationError, WalletError
|
||||
from pyfragment import FragmentClient, UserNotFoundError, ConfigurationError, WalletError
|
||||
|
||||
try:
|
||||
result = await client.gift_stars("@unknown", amount=100)
|
||||
|
||||
Reference in New Issue
Block a user