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.
// To install all the required packages use the following command
// npm install @metaplex-foundation/mpl-token-metadata @metaplex-foundation/umi @metaplex-foundation/umi-bundle-defaults
import {
mplTokenMetadata,
updateV1,
} from '@metaplex-foundation/mpl-token-metadata';
import {
keypairIdentity,
publicKey,
} from '@metaplex-foundation/umi';
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
import { readFileSync } from 'fs';
// Initialize Umi with Devnet endpoint
const umi = createUmi('https://api.devnet.solana.com').use(mplTokenMetadata())
// Load your wallet/keypair
const wallet = '<your wallet file path>'
const secretKey = JSON.parse(readFileSync(wallet, 'utf-8'))
const keypair = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(secretKey))
umi.use(keypairIdentity(keypair))
// Your token mint address
const mintAddress = publicKey('<your token mint address>')
// Update the fungible token metadata
await updateV1(umi, {
mint: mintAddress,
data: {
name: 'Updated Token Name',
symbol: 'UTN',
uri: 'https://arweave.net/new-metadata-uri',
sellerFeeBasisPoints: 0,
creators: null,
},
}).sendAndConfirm(umi)
console.log('Token metadata updated')
console.log('Mint:', mintAddress)
Parameters
Customize these parameters for your update:
| Parameter | Description |
|---|---|
mintAddress | The token mint address |
name | New token name (max 32 characters) |
symbol | New token symbol (max 10 characters) |
uri | New link to off-chain metadata JSON |
sellerFeeBasisPoints | Royalty percentage (usually 0 for fungibles) |
How It Works
The update process is straightforward:
- Connect with update authority - Your wallet must be the update authority for the token
- Call updateV1 - Provide the mint address and new metadata values
- 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:
- Create a new JSON metadata file with updated information
- Upload the new JSON to a storage provider (like Arweave)
- Update the
urifield 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
uriallows you to update off-chain data like images and descriptions