Tell me please. I have created a SPL token, how do I add the website and social networks to the metadata now? Previously, this could be done with the help of PR on github.
2 Answers
This was changed due to the PR method not scaling.
Now tokens support metadata and you can easily create one via:
-
Yes, but I can’t add a website and social networks to metodata. Else when creating a token on app.strataprotocol.com/launchpad in explorer, it says a warning that the token is not unique– Zero Q4Commented Sep 8, 2022 at 16:14
// Instruction to initialize the MetadataPointer Extension for the Mint Account
const initializeMetadataPointerIx =
createInitializeMetadataPointerInstruction(
mintAddress, // Mint Account address
isImmutable ? null : updateAuthority, // Authority that can set the metadata address
mintAddress, // Account address that holds the metadata
TOKEN_2022_PROGRAM_ID
);
// Instruction to initialize Metadata Account data
const initializeMetadataIx = createInitializeInstruction({
programId: TOKEN_2022_PROGRAM_ID, // Token Extension Program as Metadata Program
metadata: mintAddress, // Account address that holds the metadata
updateAuthority: updateAuthority, // Authority that can update the metadata
mint: mintAddress, // Mint Account address
mintAuthority: updateAuthority, // Designated Mint Authority
name: metaData.name,
symbol: metaData.symbol,
uri: metaData.uri,
});
// If additional custom fields need to be updated or added
const updateFieldIx = createUpdateFieldInstruction({
programId: TOKEN_2022_PROGRAM_ID,
metadata: mintAddress,
updateAuthority: updateAuthority,
field: metaData.additionalMetadata[0][0], // Key of the field to update
value: metaData.additionalMetadata[0][1], // Value of the field to update
});
I did this but I dont know if it works since I am on devnet