Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huantt/ton-assets-go
This repository provides the data of popular Jettons and Accounts on the TON blockchain. The data is pulled automatically from tonkeeper/ton-assets that is whitelisted on Tonkeeper Wallet.
https://github.com/huantt/ton-assets-go
jetton jettons ton ton-assets
Last synced: 2 months ago
JSON representation
This repository provides the data of popular Jettons and Accounts on the TON blockchain. The data is pulled automatically from tonkeeper/ton-assets that is whitelisted on Tonkeeper Wallet.
- Host: GitHub
- URL: https://github.com/huantt/ton-assets-go
- Owner: huantt
- Created: 2024-04-23T04:46:51.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T18:35:21.000Z (2 months ago)
- Last Synced: 2024-10-21T19:52:39.840Z (2 months ago)
- Topics: jetton, jettons, ton, ton-assets
- Language: Go
- Homepage:
- Size: 281 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## About me
This repository provides the data of popular Jettons and Accounts on the TON blockchain.
The data is pulled automatically from [tonkeeper/ton-assets](https://github.com/tonkeeper/ton-assets) (whitelisted addresses on Tonkeeper Wallet).## Install
```shell
go get github.com/huantt/ton-assets-go
```## How to use
### Get Jetton by symbol
```go
jetton := assets.GetJettonBySymbol("fish")
if jetton == nil {
fmt.Println("Token is not whitelisted")
} else {
fmt.Println("Token address: " + jetton.Address)
}
```
_Token symbols are case-insensitive_### Get Jetton by address
_You can input both a friendly address and a raw address_
```go
jetton := assets.GetJettonByAddress("EQATcUc69sGSCCMSadsVUKdGwM1BMKS-HKCWGPk60xZGgwsK")
if jetton == nil {
fmt.Println("Token is not whitelisted")
} else {
fmt.Println("Token symbol: " + jetton.Symbol)
}
```### Get account by address
```go
account := assets.GetAccountByAddress("EQBfAN7LfaUYgXZNw5Wc7GBgkEX2yhuJ5ka95J1JJwXXf4a8")
if account == nil {
fmt.Println("Account is not whitelisted")
} else {
fmt.Println("Account name: " + account.Name + " - Require memo: "+ fmt.Sprint(account.RequireMemo) + " - Workchain: " + fmt.Sprint(account.WorkChain))
}
```
_You can input both a friendly address and a raw address_