Search code examples
solanametaplex

CPI calls to metaplex programs (metadata, token-vault, auction, etc.)


I have a use case where i'd like to update NFT's metadata from a program. How should i construct such instruction?

On a side note, could i use a PDA (owned by custom program) as update authority?


Solution

  • Yes, it's possible to edit the token metadata via CPI. It's also possible to use a PDA as the update authority, you just need to use the correct seeds when invoking the update instructions.

    The update_metadata_accounts_v2 Rust binding can be found here

    Here is an example of a PDA updating metadata https://github.com/Bonfida/name-tokenizer/blob/master/program/src/processor/create_nft.rs#L317=