Skip to content

Commit 2a7df75

Browse files
committed
Replace Walkthrough
1 parent 44e4afc commit 2a7df75

2 files changed

Lines changed: 57 additions & 33 deletions

File tree

src/star-and-ton-balance.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Star and TON Balance & Transactions
3+
parent: /#walkthrough
4+
walkthrough:
5+
track: main
6+
order: 21
7+
---
8+
9+
Clients can check their Telegram Star balance, TON balance, and transaction history.
10+
11+
## Getting the Star Balance
12+
13+
Use {{ "getStarBalance" |> m }} with `"me"` to get the current account's Star balance.
14+
15+
```ts
16+
const balance = await client.getStarBalance("me");
17+
18+
console.log(balance.amount, balance.nanos);
19+
```
20+
21+
## Listing Star Transactions
22+
23+
Use {{ "getStarTransactions" |> m }} to get the current account's Star 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+
```
34+
35+
## Getting the TON Balance
36+
37+
Use {{ "getTonBalance" |> m }} to get the current account's TON balance.
38+
39+
```ts
40+
const tonBalance = await client.getTonBalance("me");
41+
42+
console.log(tonBalance);
43+
```
44+
45+
## Listing TON Transactions
46+
47+
Use {{ "getTonTransactions" |> m }} to get the current account's TON transactions.
48+
49+
```ts
50+
const { transactions } = await client.getTonTransactions("me", {
51+
limit: 10,
52+
});
53+
54+
for (const transaction of transactions) {
55+
console.log(transaction.id, transaction.amount);
56+
}
57+
```

src/star-balance-and-transactions.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)