blocto / solana-go-sdk

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

Replacing METAPLEX functions (anchor) #51

Closed datboysus closed 2 years ago

datboysus commented 2 years ago

Hey! First of all, thanks for a great library. The question is: how can I replace this function from metaplex code?

const getMetadata = async (
  mint: anchor.web3.PublicKey,
): Promise<anchor.web3.PublicKey> => {
  return (
    await anchor.web3.PublicKey.findProgramAddress(
      [
        Buffer.from('metadata'),
        TOKEN_METADATA_PROGRAM_ID.toBuffer(),
        mint.toBuffer(),
      ],
      TOKEN_METADATA_PROGRAM_ID,
    )
  )[0];
};
yihau commented 2 years ago

sorry for the late! you can take a look at https://github.com/portto/solana-go-sdk/blob/ffb708d3c8fe7fbbf65b1e3ac178ef68fb7aa95e/program/metaplex/tokenmeta/utils.go#L9-L22

yihau commented 2 years ago

feel free to open another issue for Solana SDK problems