blocto / solana-go-sdk

Solana Golang SDK
https://blocto.github.io/solana-go-sdk/
MIT License
366 stars 95 forks source link

Get mint address for a given address #77

Closed Joeyboy92 closed 2 years ago

Joeyboy92 commented 2 years ago

Hey I need a way of identifying what type of tokens the address is for so I need a way of querying a given public address to get it's mint address.

If I create a new client what method do I use to get the tokens mint address ?

c := client.NewClient(rpc.MainnetRPCEndpoint)

Thanks 👍

scottywm commented 2 years ago

Actually I need to know how to do this to.

I need to know how to identify what type of cryptocurrency the given public address belongs to and I need a way of identifying what token the given token address belongs to.

How can we do this?

yihau commented 2 years ago

you can take a look at https://github.com/portto/solana-go-sdk/blob/main/docs/_examples/client/get-token-account/main.go the mint is included in the token account data.