docs: update documentation to reflect changes from TON to GRAM, including method renaming and new top-up method

This commit is contained in:
bohd4nx
2026-06-16 01:39:23 +03:00
parent e0251d5d04
commit f7f8982554
16 changed files with 135 additions and 75 deletions
+14 -2
View File
@@ -6,21 +6,33 @@ Use this minimal example to verify that your credentials, cookies, and wallet se
import asyncio
from pyfragment import FragmentClient
from pyfragment.enums import PaymentMethod
async def main() -> None:
async with FragmentClient(
seed="word1 word2 ... word24",
api_key="YOUR_TONAPI_KEY",
api_key="YOUR_API_KEY", # tonconsole.com (tonapi, default) or t.me/toncenter
cookies={
"stel_ssid": "...",
"stel_dt": "...",
"stel_token": "...",
"stel_ton_token": "...",
},
wallet_version="V5R1", # or "V4R2", "HighloadV2", "HighloadV3R1"
api_provider="tonapi", # or "toncenter"
) as client:
wallet = await client.get_wallet()
print(wallet)
print(f"GRAM: {wallet.gram_balance} | USDT: {wallet.usdt_balance}")
recipient = "https://t.me/username" # also: @username, username
stars = await client.purchase_stars(recipient, amount=500, payment_method=PaymentMethod.USDT_GRAM)
print(f"Sent {stars.amount} Stars to {stars.username} | tx: {stars.transaction_id}")
premium = await client.purchase_premium(recipient, months=6, payment_method=PaymentMethod.GRAM)
print(f"Sent Premium {premium.amount}m to {premium.username} | tx: {premium.transaction_id}")
asyncio.run(main())
```