I'm trying to add metadata for a fungible SPL token, which was done via token-list before. I have tried using strata protocol, but it does not show up on the list so cannot be done. Is there a simple js codeblock or CLI command to add the metadata easily?

  • On Strata just paste the mint address and it will work
    – Andres
    Oct 2, 2022 at 19:22

2 Answers 2


To create metadata account on any SPL token you can create using (JS version) :

const createMetadataAccount = async (metadataPDA: PublicKey, mint: PublicKey, payer: PublicKey, metadataData: any) => {
        const tx = new Transaction().add(
                metadata: metadataPDA,
                mint: mint,
                mintAuthority: payer,
                payer: payer,
                updateAuthority: payer,
                        data: metadataData,
                        isMutable: true
        return tx;

To get the metadata PDA

const TOKEN_METADATA_PROGRAM_ID = new PublicKey(

const getMetadata = async (
        mint: PublicKey,
    ): Promise<PublicKey> => {
        return (
            await PublicKey.findProgramAddress(

The data part which is being passed in instruction can be constructed like :

const metadataData = {
                name: "Test Token",
                symbol: "Test",
                uri: uri, // Arweave URI link which uses metaplex standard
                sellerFeeBasisPoints: 0,
                creators: null,
                collection: null,
                uses: null

Creating the transaction and passing the parameters :

const addMetadata = (mintAddress: PublicKey, connection: Connection) => {
     const payer = Keypair.fromSecretKey(new Uint8Array(JSON.parse(fs.readFileSync(keypair, { encoding: "utf8" }))));
     const metadataAccount = await getMetadata(mintAddress);
     const tx= await createMetadataAccount(metadataAccount, mintAddress, payer, metadataData);
     const transactionId = await sendAndConfirmTransaction(

You can use Metaboss to create an SPL-Token with Metadata or add Metadata to an existing token.



Decorate an existing SPL token mint with metadata.


Specify the existing mint address and path to a metadata file that contains the name, symbol and uri fields in a JSON format.

metaboss create metadata -a <mint_address> -m <metadata_file>

Your Answer

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

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