Getting Started

Update Token Metadata

Update the metadata of your fungible token to change its name, symbol, image, or other properties.

Update Token Metadata

In the following section you can find a full code example and the parameters that you might have to change. This uses the Token Metadata program to update on-chain metadata.

1// npm install @metaplex-foundation/mpl-token-metadata @metaplex-foundation/umi @metaplex-foundation/umi-bundle-defaults
2import {
3 fetchDigitalAsset,
4 mplTokenMetadata,
5 updateV1,
6} from '@metaplex-foundation/mpl-token-metadata'
7import {
8 keypairIdentity,
9 publicKey,
10} from '@metaplex-foundation/umi'
11import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
12import { readFileSync } from 'fs'
13
14// Initialize Umi with your RPC endpoint
15const umi = createUmi('https://api.devnet.solana.com').use(mplTokenMetadata())
16
17// Load your wallet keypair (must be the update authority)
18const wallet = '<your wallet file path>'
19const secretKey = JSON.parse(readFileSync(wallet, 'utf-8'))
20const keypair = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(secretKey))
21umi.use(keypairIdentity(keypair))
22
23// Your token mint address
24const mintAddress = publicKey('<your token mint address>')
25
26// Fetch existing token data
27const asset = await fetchDigitalAsset(umi, mintAddress)
28
29// Update the token metadata (name, symbol, and URI)
30await updateV1(umi, {
31 mint: mintAddress,
32 authority: umi.identity,
33 data: {
34 ...asset.metadata,
35 name: 'Updated Token Name',
36 symbol: 'UTN',
37 uri: 'https://example.com/updated-metadata.json',
38 },
39}).sendAndConfirm(umi)
40
41console.log('Token metadata updated successfully')
42console.log('Mint:', mintAddress)
43console.log('New name:', 'Updated Token Name')
44console.log('New URI:', 'https://example.com/updated-metadata.json')

Parameters

Customize these parameters for your update:

ParameterDescription
mintAddressThe token mint address
nameNew token name (max 32 characters)
symbolNew token symbol (max 10 characters)
uriNew link to off-chain metadata JSON
sellerFeeBasisPointsRoyalty percentage (usually 0 for fungibles)

How It Works

The update process is straightforward:

  1. Connect with update authority - Your wallet must be the update authority for the token
  2. Call updateV1 - Provide the mint address and new metadata values
  3. Confirm transaction - The metadata is updated on-chain

What Can Be Updated

You can update the following on-chain metadata:

  • Name - The display name of your token
  • Symbol - The short ticker symbol
  • URI - Link to off-chain JSON metadata (image, description, etc.)
  • Seller fee basis points - Royalty percentage

Requirements

To update token metadata, you must:

  • Be the update authority - Only the designated update authority can modify metadata
  • Have a mutable token - The token must have been created with isMutable: true

Updating Off-Chain Metadata

To update the token image or description, you need to:

  1. Create a new JSON metadata file with updated information
  2. Upload the new JSON to a storage provider (like Arweave)
  3. Update the uri field to point to the new JSON file
{
"name": "Updated Token Name",
"symbol": "UTN",
"description": "An updated description for my token",
"image": "https://arweave.net/new-image-hash"
}

Important Notes

  • Updates only affect the metadata, not the token itself or existing balances
  • If your token was created as immutable, you cannot update its metadata
  • Changing the uri allows you to update off-chain data like images and descriptions