solana-go-sdk icon indicating copy to clipboard operation
solana-go-sdk copied to clipboard

Get mint address for a given address

Open Joeyboy92 opened this issue 2 years ago • 2 comments

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 👍

Joeyboy92 avatar Jul 31 '22 15:07 Joeyboy92

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?

scottywm avatar Aug 03 '22 16:08 scottywm

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.

yihau avatar Aug 04 '22 18:08 yihau