Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jetton.GetJettonDataAtBlock doest works for jetton contracts #233

Open
livingroot opened this issue Aug 14, 2024 · 1 comment
Open

jetton.GetJettonDataAtBlock doest works for jetton contracts #233

livingroot opened this issue Aug 14, 2024 · 1 comment

Comments

@livingroot
Copy link
Contributor

livingroot commented Aug 14, 2024

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.

content, err := nft.ContentFromCell(contentCell)
if err != nil {
return nil, fmt.Errorf("failed to load content from contentCell: %w", err)
}

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.

@xssnick
Copy link
Owner

xssnick commented Sep 10, 2024

Hi, you can use GetAttribute("address") and etc to get any param

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants