mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
859 B
859 B
Top Up GRAM
Use this method to send GRAM (ex TON) to a user's Telegram balance.
Method
await client.topup_gram(
username: str,
amount: int,
show_sender: bool = True,
) -> AdsTopupResult
Parameters
username: recipient Telegram username —@username,username, orhttps://t.me/usernameamount: integer from1to1_000_000_000show_sender: controls sender visibility
amount must be an integer in the allowed range.
Return
AdsTopupResult(transaction_id, username, amount)
Typical errors
ConfigurationError: invalid amountUserNotFoundError: recipient not found on FragmentWalletError: insufficient GRAM (ex TON) balance
Example
result: AdsTopupResult = await client.topup_gram("@username", amount=10, show_sender=True)
print(result.transaction_id)