tonutils-go icon indicating copy to clipboard operation
tonutils-go copied to clipboard

jetton.GetJettonDataAtBlock doest works for jetton contracts

Open livingroot opened this issue 6 months ago • 1 comments

If you need to access Jetton contract data, such as the name, symbol, or decimals, you'll encounter an issue because the GetJettonDataAtBlock method currently only refers to the NFT package and parses NFT data.

https://github.com/xssnick/tonutils-go/blob/9db1a1391b6c8007f5d2e6ee812aeb55764c50c8/ton/jetton/jetton.go#L137-L140

So ContentOnchain in a ContentFromCell for jetton method must look like that:

ContentOnchain: &ContentOnchain{
	Address:     string(getOnchainVal(dict, "address")),
	Name:        string(getOnchainVal(dict, "name")),
	Symbol:      string(getOnchainVal(dict, "symbol")),
	Decimals:    string(getOnchainVal(dict, "decimals")),
	Image:       string(getOnchainVal(dict, "image")),
	Description: string(getOnchainVal(dict, "description")),
	attributes:  dict,
},

I plan to create a pull request later unless someone else addresses this first.

livingroot avatar Aug 14 '24 19:08 livingroot