-
Notifications
You must be signed in to change notification settings - Fork 210
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
Pls help me, how to get token metadata? #190
Comments
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:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
The text was updated successfully, but these errors were encountered: