Skip to content

Commit

Permalink
Merge pull request #433 from reveloper/weekly_update_48
Browse files Browse the repository at this point in the history
Weekly update 48
  • Loading branch information
reveloper committed Dec 2, 2023
2 parents f035482 + 2caf537 commit 4d3aaa6
Show file tree
Hide file tree
Showing 17 changed files with 198 additions and 248 deletions.
3 changes: 0 additions & 3 deletions docs/develop/blockchain/sharding-lifecycle.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Infinity Sharding Paradigm

:::danger
Page is under development.
:::

## Understanding Split Merge in TON Blockchain

Expand Down
190 changes: 7 additions & 183 deletions docs/develop/dapps/apis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@

**High availability blockchain APIs are the core element of secure, convenient and fast development of useful applications on TON.**

- [TON Center API](/develop/dapps/apis/toncenter) — fast and reliable HTTP API for The Open Network. Being based on tonlib, it allows to get all information about accounts, transactions and blocks.
- [TON HTTP API](https://tonapi.io/) — API that allows to work with the _indexed blockchain information_.
- [TON HTTP API](/develop/dapps/apis/toncenter) — API that allows to work with the _indexed blockchain information_.
- [TON ADNL API](/develop/dapps/apis/adnl) — secure API to communicate with TON, based on ADNL protocol.

## Third party APIs
- [ton-api-v4](https://mainnet-v4.tonhubapi.com) - another lite-api focused on speed via aggressive cashing in CDN.
- [tonapi.io](https://tonapi.io/docs) - fast indexed API which provides basic data about accounts, transactions, blocks, application-specific data about NFT, Auctions, Jettons, TON DNS, Subscriptions. It also provides annotated data on transaction chains.
- [tonapi.io](https://docs.tonconsole.com/tonapi/api-v2) - fast indexed API which provides basic data about accounts, transactions, blocks, application-specific data about NFT, Auctions, Jettons, TON DNS, Subscriptions. It also provides annotated data on transaction chains.
- [dton.io](https://dton.io/graphql/) - GraphQL API with that can provide data about accounts, transactions and blocks, as well as application-specific data about NFT, Auctions, Jettons and TON DNS.
- [ton-api-v4](https://mainnet-v4.tonhubapi.com) - another lite-api focused on speed via aggressive cashing in CDN.
- [evercloud.dev](https://ton-mainnet.evercloud.dev/graphql) - GraphQL API for basic queries in TON.
- [everspace.center](https://everspace.center/toncoin) - Simple RPC API for accessing TON Blockchain.


## Examples

## Additional APIs

### API for current Toncoin value
### Toncoin rate APIs

* https://tonapi.io/v2/rates?tokens=ton&currencies=ton%2Cusd%2Crub
* https://coinmarketcap.com/api/documentation/v1/
* https://apiguide.coingecko.com/getting-started


### Convert Address into Raw and Friendly forms
### Address Convert APIs


:::info
Expand Down Expand Up @@ -71,182 +69,8 @@ Response body
```


### Retrieve data for the Wallet Smart Contract


#### Toncenter

curl
```curl
curl -X 'GET' \
'https://toncenter.com/api/v2/getWalletInformation?address=EQApAj3rEnJJSxEjEHVKrH3QZgto%2FMQMOmk8l72azaXlY1zB' \
-H 'accept: application/json'
```
Response Body

```json
{
"ok": true,
"result": {
"wallet": true,
"balance": "2220156241",
"account_state": "active",
"wallet_type": "wallet v4 r2",
"seqno": 3,
"last_transaction_id": {
"@type": "internal.transactionId",
"lt": "35169513000005",
"hash": "3XPXsQ+3WGE+HlhNQYqglMR6ushMEycJJPpV0zn1NIY="
},
"wallet_id": 698983191
}
}
```


#### Tonapi

curl
```curl
curl -X 'GET' \
'https://tonapi.io/v2/accounts/0%3A29023deb1272494b112310754aac7dd0660b68fcc40c3a693c97bd9acda5e563' \
-H 'accept: application/json'
```

Response Body

```json
{
"address": "0:29023deb1272494b112310754aac7dd0660b68fcc40c3a693c97bd9acda5e563",
"balance": 2220156241,
"last_activity": 1675978478,
"status": "active",
"interfaces": [
"wallet_v4r2",
"wallet_v4",
"wallet"
],
"name": "nft-recycle.ton",
"is_scam": false,
"memo_required": false,
"get_methods": []
}
```


### NFT

#### Retrieve all NFT items by owner address

**GET /v2/accounts/{account_id}/nfts**

curl
```curl
curl -X 'GET' \
'https://tonapi.io/v2/accounts/EQCjk1hh952vWaE9bRguFkAhDAL5jj3xj9p0uPWrFBq_GEMS/nfts?limit=1000&offset=0&indirect_ownership=false' \
-H 'accept: application/json'
```

```json
{
"nft_items": [
{
"address": "0:1bfa1550d1031186a8d7c90ea9ddab3d4fecb9f64e80e087d2b9305cbc06314b",
"index": 163,
"owner": {
"address": "0:a3935861f79daf59a13d6d182e1640210c02f98e3df18fda74b8f5ab141abf18",
"name": "Getgems Marketplace",
"is_scam": false
},
"collection": {
"address": "0:fc3b095b41ee438d0144e727657a6a3be207b2ff4d95f26874289e82c26fd835",
"name": ""
},
"verified": true,
"metadata": {
"name": "Solarbird #163",
"image": "https://s.getgems.io/nft/b/c/62cd827425200ebb6a9acb47/163/image.png",
"attributes": [
],
"description": "Cool bird for the cool holder"
},
"previews": [
{
"resolution": "100x100",
"url": "https://cache.tonapi.io/imgproxy/2UPH1P-oniVot8ea6nnoz-Foq4JivCHBvhufPJw5QEU/rs:fill:100:100:1/g:no/aHR0cHM6Ly9zLmdldGdlbXMuaW8vbmZ0L2IvYy82MmNkODI3NDI1MjAwZWJiNmE5YWNiNDcvMTYzL2ltYWdlLnBuZw.webp"
}
],
"approved_by": []
}
]
}
```

### Jetton


#### Retrieve jetton metadata by jetton master address

**GET /v2/jettons/{account_id}**

curl
```curl
curl -X 'GET' \
'https://tonapi.io/v2/jettons/0%3A729c13b6df2c07cbf0a06ab63d34af454f3d320ec1bcd8fb5c6d24d0806a17c2' \
-H 'accept: application/json'
```

```json
{
"mintable": true,
"total_supply": "100810730032",
"metadata": {
"address": "0:729c13b6df2c07cbf0a06ab63d34af454f3d320ec1bcd8fb5c6d24d0806a17c2",
"name": "jUSDT",
"symbol": "jUSDT",
"decimals": "6",
"image": "https://bridge.ton.org/token/1/0xdac17f958d2ee523a2206206994597c13d831ec7.png",
"description": "USDT transferred from Ethereum via bridge.ton.org. Token address in Ethereum: 0xdAC17F958D2ee523a2206206994597C13D831ec7"
},
"verification": "whitelist"
}
```

#### Retrieve all Jettons balances by owner's wallet address (account)

**GET /v2/accounts/{account_id}/jettons**

curl
```curl
curl -X 'GET' \
'https://tonapi.io/v2/accounts/0%3A408da3b28b6c065a593e10391269baaa9c5f8caebc0c69d9f0aabbab2a99256b/jettons' \
-H 'accept: application/json'
```

```json
{
"balances": [
{
"balance": "10000000000",
"wallet_address": {
"address": "0:83add688b3517ee478dc7defecc76ca24add7a7f008f46ec0e88cc381f37230d",
"is_scam": false
},
"jetton": {
"address": "0:65aac9b5e380eae928db3c8e238d9bc0d61a9320fdc2bc7a2f6c87d6fedf9208",
"name": "Scaleton",
"symbol": "SCALE",
"decimals": 9,
"image": "https://cache.tonapi.io/imgproxy/jHx0m3tMBFj9z9vLy1cooH_v8DIi_2Zi43RLxyfga3g/rs:fill:200:200:1/g:no/aXBmczovL1FtU01pWHNaWU1lZndyVFEzUDZIbkRRYUNwZWNTNEVXTHBnS0s1RVgxRzhpQTg.webp",
"verification": "whitelist"
}
}
]
}
```


## See Also
* [TON Center API](/develop/dapps/apis/toncenter)
* [TON HTTP API](/develop/dapps/apis/toncenter)
* [List of SDKs](/develop/dapps/apis/sdk)
* [Smart Contract Examples](/develop/smart-contracts/examples)
46 changes: 25 additions & 21 deletions docs/develop/dapps/apis/toncenter.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
# TON Center API
# TON HTTP API

_Standard HTTP JSON RPC. Similar to other blockchain APIs._
_Standard HTTP JSON RPC similar to other blockchain APIs._

Clients connect to the [ton-http-api](https://github.com/toncenter/ton-http-api) server that proxies requests to the liteserver (node) using TonLib.
## RPC Nodes

You can connect to public [toncenter.com](https://toncenter.com) or run your own http-api instance.
:::tip
[GetBlock Nodes](https://getblock.io/nodes/ton/) - 🚀 Instant Node installation with just a few clicks.
:::

* [GetBlock Nodes](https://getblock.io/nodes/ton/) — connect and test your dApps using GetBlocks Nodes
* [TON Access](https://www.orbs.com/ton-access/) - HTTP API for The Open Network (TON).
* [Toncenter](https://toncenter.com/api/v2/) — community-hosted project for Quick Start with API. (Get an API key [@tonapibot](https://t.me/tonapibot))
* [ton-node-docker](https://github.com/fmira21/ton-node-docker) - [⭐NEW] Docker Full Node and Toncenter API.
* [toncenter/ton-http-api](https://github.com/toncenter/ton-http-api) — run your own RPC node.
* [nownodes.io](https://nownodes.io/nodes) — NOWNodes full Nodes and blockbook Explorers via API.
* [Chainbase](https://chainbase.com/chainNetwork/TON) — Node API and data infrastructure for The Open Network.

## Pros & Cons

- ✅ Habitual and suitable for a quick start, this is perfect for every newcomer looking to play with TON.
- ✅ Habitual and suitable for a quick start, this is perfect for every newcomer looking to play with TON.
- ✅ Web-oriented. Perfect to interact with TON transactions, smart contracts from Web.

- ❌ Simplified. It's not possible to receive information where you need an indexed TON API.
- ❌ HTTP-Middleware. You can't fully trust server responses, because they do not contain _Merkle proofs_ to validate that your data is genuine.
- ❌ Simplified. It's not possible to receive information where you need an indexed TON API.
- ❌ HTTP-Middleware. You can't fully trust server responses, because they do not contain _Merkle proofs_ to validate that your data is genuine.

## Get API key

To work with public TonCenter API you need an API key:
### Toncenter API

* Get an API key for Mainnet and Testnet: [@tonapibot](https://t.me/tonapibot)
Clients connect to the [ton-http-api](https://github.com/toncenter/ton-http-api) server that proxies requests to the liteserver (node) using TonLib.

## RPC Nodes
You can connect to public [toncenter.com](https://toncenter.com) or run your own http-api instance.

:::tip
[GetBlock Nodes](https://getblock.io/nodes/ton/) - 🚀 Instant Node installation with just a few clicks.
:::

* [GetBlock Nodes](https://getblock.io/nodes/ton/) — connect and test your dApps using GetBlocks Nodes
* [https://www.orbs.com/ton-access/](https://www.orbs.com/ton-access/) - HTTP API for The Open Network (TON).
* [https://toncenter.com/api/v2/](https://toncenter.com/api/v2/) — community-hosted project for Quick Start with API.
* [ton-node-docker](https://github.com/fmira21/ton-node-docker) - [⭐NEW] Docker Full Node and Toncenter API.
* [toncenter/ton-http-api](https://github.com/toncenter/ton-http-api) — run your own RPC node.
* [nownodes.io](https://nownodes.io/nodes) — NOWNodes full Nodes and blockbook Explorers via API.
* [Chainbase](https://chainbase.com/chainNetwork/TON) — Node API and data infrastructure for The Open Network.
## Get API key

To work with public TonCenter API you need an API key:

* Get an API key for Mainnet and Testnet: [@tonapibot](https://t.me/tonapibot)

## See Also
* [TON ADNL API](/develop/dapps/apis/adnl)
Expand Down
74 changes: 74 additions & 0 deletions docs/develop/dapps/telegram-apps/design-guidelines.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

# TMA Design Guidelines

:::info
Starting with version **6.10**, Telegram has updated the color palette for Mini Apps: a couple of old ones were fixed, and new ones were added.
:::

For context let's remember the history of updates.



Changelog.
1. The `bg_color` and `secondary_bg_color` have been updated.

![](/img/docs/tma-design-guidelines/tma-design_1.png)


What are the reasons:

• These colors were originally intended for use on page backgrounds, not UI controls.

• Therefore, for consistency, they have been updated.

• To color the backgrounds of different sections and cards, section_bg_color was added.

To improve the appearance of your applications, you should slightly adjust the use of color variables.

Above is a clear example that explains exactly what will change for iOS. There should be no changes on Android.



New colors.
Also, many new colors were added. Most of them are most noticeable on Android. Therefore, the examples below will be shown based on Android, but are relevant for all platforms.

![](/img/docs/tma-design-guidelines/tma-design_2.png)

2. For Mini Apps, the ability to use Telegram header colors has become available.

![](/img/docs/tma-design-guidelines/tma-design_3.png)


3. The token accent_text_color has become available, which is useful for any accent elements in your applications. Previously, everyone used the less suitable dark link_color.

![](/img/docs/tma-design-guidelines/tma-design_4.png)

4. For all secondary cell labels, it's now better to use `subtitle_text_color`. This will allow for more contrasting label, improving the accessibility of your applications.

![](/img/docs/tma-design-guidelines/tma-design_5.png)


5. For section headers of cards, there is now a dedicated token: `section_header_text_color`.

![](/img/docs/tma-design-guidelines/tma-design_6.png)


6. For cells whose pressing will lead to a destructive action, you can now use `destructive_text_color` instead of custom ones.


<p align="center">
<br />
<img width="360" src="/img/docs/tma-design-guidelines/tma-design_7.png" alt="" />
<br />
</p>



7. A reasonable question arises: how should `link_color` and `hint_color` be used now?

I recommend using them as colors for hint sections under the sections, and the link color for such backgrounds as `secondary_bg_color`.


## See Also

* [Original Source](https://telegra.ph/Changes-in-Color-Variables-for-Telegram-Mini-Apps-11-20)
11 changes: 11 additions & 0 deletions docs/develop/dapps/telegram-apps/tips-and-tricks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,14 @@ To prevent such accidental closures, enable `closing_behavior` in the TMA. This
```typescript
window.Telegram.WebApp.enableClosingConfirmation()
```


## How to specify a description for a certain language in the TMA?

:::tip
You can configure your description with following methods:

* https://core.telegram.org/bots/api#setmydescription
* https://core.telegram.org/bots/api#setmyshortdescription

:::
3 changes: 2 additions & 1 deletion docs/develop/howto/blockchain-configs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Config Parameters

:::info
The Russian version of this article can be found [here](https://github.com/delovoyhomie/description-config-for-TON-Blockchain/blob/main/Russian-version.md).
Read live values via [tonviewer](https://tonviewer.com/config)
:::

## 👋 Introduction
Expand Down Expand Up @@ -542,3 +542,4 @@ On this page, you can find active network configurations of the TON Blockchain:

- Mainnet: https://ton.org/global-config.json
- Testnet: https://ton.org/testnet-global.config.json
- [Russian Version](https://github.com/delovoyhomie/description-config-for-TON-Blockchain/blob/main/Russian-version.md).
Loading

0 comments on commit 4d3aaa6

Please sign in to comment.