3

Using @metaplex-foundation/mpl-token-metadata I could get token metadata for a standard SPL Token.

fetchDigitalAsset(umi, publicKey(tokenAddress))

However for SPL Token 2022 token, it's showing this error.

AccountNotFoundError: The account of type [Metadata] was not found at the provided address

It does seem like the metadata exist on metaplex for this token. https://solscan.io/token/FLUXBmPhT3Fd1EDVFdg46YREqHBeNypn1h4EbnTzWERX#metadata

So how do we get metaplex token metadata for SPL Token-2022 token?

1 Answer 1

3

Umi offers a program repository which can be used to bind a program address with another one, even using their name aliases.

umi.programs.bind('splToken', 'splToken2022');
const asset = await fetchDigitalAsset(umi, myMintAddress);

Optionally, you can unbind it afterwards to go back to using the regular SPL Token program.

umi.programs.unbind('splToken');
2
  • Doesn't work. gives same error Jan 9 at 13:45
  • Oh based on the question related to Token22 I assumed the failure was related to wrong PDA derivation. However, the error occurs on the Metadata account whose derivation is not altered by the token program you use. Therefore, either the asset doesn’t exist or you’re providing the wrong address. This should be the address of the Mint account of the asset. Not the address of the Token account as your variable name suggests. Let me know if that fixes your issue and I’ll update the answer. Jan 9 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.