File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ Its key features include:
2323
2424### Walkthrough
2525
26- Start with the main walkthrough. Individual sections are tagged when they apply only to user accounts or bots.
27-
2826#### Main
2927
3028{{ "main" |> walkthrough }}
Original file line number Diff line number Diff line change 1+ ---
2+ title : Star Balance and Transactions
3+ parent : /#walkthrough
4+ walkthrough :
5+ track : main
6+ order : 21
7+ ---
8+
9+ Clients can check their Telegram Star balance and transaction history.
10+
11+ ## Getting the Balance
12+
13+ Use {{ "getStarBalance" |> m }} with ` "me" ` to get the current account's balance.
14+
15+ ``` ts
16+ const balance = await client .getStarBalance (" me" );
17+
18+ console .log (balance .amount , balance .nanos );
19+ ```
20+
21+ ## Listing Transactions
22+
23+ Use {{ "getStarTransactions" |> m }} to get the current account's transactions.
24+
25+ ``` ts
26+ const { transactions } = await client .getStarTransactions (" me" , {
27+ limit: 10 ,
28+ });
29+
30+ for (const transaction of transactions ) {
31+ console .log (transaction .id , transaction .amount .amount );
32+ }
33+ ```
Original file line number Diff line number Diff line change 1+ ---
2+ title : Star Payment Refunds
3+ parent : /#walkthrough
4+ walkthrough :
5+ track : bot
6+ order : 17
7+ ---
8+
9+ Bots can refund payments made with Telegram Stars.
10+
11+ ## Refunding a Payment
12+
13+ Use {{ "refundStarPayment" |> m }} with the charged user's identifier and the ` telegramPaymentChargeId ` from the successful payment.
14+
15+ ``` ts
16+ await client .refundStarPayment (userId , telegramPaymentChargeId );
17+ ```
You can’t perform that action at this time.
0 commit comments