Closed SyugamCan closed 4 months ago
yes @SyugamCan, you are right. It's better to take a look at this repo
to get at least something you can use the next script
package main
import (
"context"
"github.com/davecgh/go-spew/spew"
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/programs/token"
"github.com/gagliardetto/solana-go/rpc"
)
func main() {
mintKey := solana.MPK("2bjao38z4hUC1wY5yQiDhRF43TjLoBpyPSQhsikhCBEr")
client := rpc.New(rpc.MainNetBeta.RPC)
var mint token.Mint
client.GetAccountDataInto(context.TODO(), mintKey, &mint)
metadataPDA, _, err := solana.FindTokenMetadataAddress(mintKey)
if err != nil {
panic(err)
}
spew.Dump(mint)
spew.Dump(metadataPDA)
}
Output:
(token.Mint) {
MintAuthority: (*solana.PublicKey)(<nil>),
Supply: (uint64) 999935143218046,
Decimals: (uint8) 6,
IsInitialized: (bool) true,
FreezeAuthority: (*solana.PublicKey)(<nil>)
}
(solana.PublicKey) (len=32 cap=32) GJvLsXpLttda51tBR2bFU3wd8AoJULNgjybwxAkFVUWx
meta, err := tokenregistry.GetTokenRegistryEntry(context.Background(), client, mintAddress) token: 2bjao38z4hUC1wY5yQiDhRF43TjLoBpyPSQhsikhCBEr and err is "not found" i guess we should interact withMetaplex is there any new func to get meta?