Fragment Donor SDKSource

Version 0.1.3 · Registry installation commands use exact versions.

How to send Telegram Stars to a username

A practical recipient-check, wallet-balance, purchase, and reconciliation flow for sending Telegram Stars to an @username.

Purchase requests transmit your wallet mnemonic and Fragment session/cookie to the API operator.

Step 1: normalize the recipient username and call get-user-info without wallet headers. Stop if the recipient is invalid. Step 2: read the wallet balance on the backend and keep TON and USDT values as decimal strings.

Step 3: record one internal purchase intent with the username, Stars amount, and chosen payment method. Step 4: submit buy-stars exactly once with the mnemonic and Fragment cookie supplied at runtime.

Step 5: treat only HTTP success with ok=true as the returned success state. Preserve tx_hash and other unknown response fields. For 429, 503, timeout, malformed response, or unconfirmed=true, surface the result for reconciliation instead of resubmitting the purchase.

Use an injected mock transport in automated tests. You can verify request fields, error handling, redaction, and no-duplicate behavior without spending real wallet funds.

Example

GET /get-user-info/?username=durov
GET /wallet-balance/
POST /buy-stars/

username=durov&amount=100&payment_method=usdt_ton

Continue reading

Telegram Stars API: send Stars to a username · Buy and gift Telegram Stars through the API · Payment timeout: prevent duplicate Telegram Stars purchases

OpenAPI 3.0 · Postman collection