Skip to content

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.

Notifications You must be signed in to change notification settings

huantt/ton-assets-go

Repository files navigation

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 (whitelisted addresses on Tonkeeper Wallet).

Install

go get github.com/huantt/ton-assets-go

How to use

Get Jetton by symbol

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

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

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

About

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.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published