시작하기
토큰 메타데이터 업데이트하기
Last updated November 28, 2025
대체 가능 토큰의 메타데이터를 업데이트하여 이름, 심볼, 이미지 또는 기타 속성을 변경합니다.
토큰 메타데이터 업데이트하기
다음 섹션에서 전체 코드 예제와 변경이 필요할 수 있는 파라미터를 확인할 수 있습니다. Token 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')
1# Update Token Metadata using the Metaplex CLI
2
3# Interactive editor mode (opens metadata JSON in your default editor)
4mplx toolbox token update <MINT_ADDRESS> --editor
5
6# Update specific fields via flags
7mplx toolbox token update <MINT_ADDRESS> --name "New Token Name"
8mplx toolbox token update <MINT_ADDRESS> --symbol "NEW"
9mplx toolbox token update <MINT_ADDRESS> --description "Updated description"
10
11# Update with new image
12mplx toolbox token update <MINT_ADDRESS> --image ./new-image.png
13
14# Update multiple fields at once
15mplx toolbox token update <MINT_ADDRESS> \
16 --name "Updated Token" \
17 --symbol "UPD" \
18 --description "An updated token description" \
19 --image ./updated-image.png
20
21# Note: You must be the update authority to update token metadata
22# Note: --editor flag cannot be combined with other update flags
파라미터
업데이트에 맞게 다음 파라미터를 커스터마이징하세요:
| 파라미터 | 설명 |
|---|---|
mintAddress | 토큰 민트 주소 |
name | 새 토큰 이름 (최대 32자) |
symbol | 새 토큰 심볼 (최대 10자) |
uri | 새 오프체인 메타데이터 JSON 링크 |
sellerFeeBasisPoints | 로열티 비율 (대체 가능 토큰은 보통 0) |
작동 방식
업데이트 과정은 간단합니다:
- 업데이트 권한자로 연결 - 지갑이 토큰의 업데이트 권한자여야 합니다
- updateV1 호출 - 민트 주소와 새 메타데이터 값을 제공합니다
- 트랜잭션 확인 - 메타데이터가 온체인에서 업데이트됩니다
업데이트할 수 있는 것
다음 온체인 메타데이터를 업데이트할 수 있습니다:
- Name - 토큰의 표시 이름
- Symbol - 짧은 티커 심볼
- URI - 오프체인 JSON 메타데이터 링크 (이미지, 설명 등)
- Seller fee basis points - 로열티 비율
요구 사항
토큰 메타데이터를 업데이트하려면 다음이 필요합니다:
- 업데이트 권한자여야 함 - 지정된 업데이트 권한자만 메타데이터를 수정할 수 있습니다
- 가변 토큰이어야 함 - 토큰이
isMutable: true로 생성되어야 합니다
오프체인 메타데이터 업데이트
토큰 이미지나 설명을 업데이트하려면:
- 업데이트된 정보를 포함하는 새 JSON 메타데이터 파일 생성
- 새 JSON을 스토리지 제공업체(Arweave 등)에 업로드
uri필드를 새 JSON 파일을 가리키도록 업데이트
{
"name": "Updated Token Name",
"symbol": "UTN",
"description": "An updated description for my token",
"image": "https://arweave.net/new-image-hash"
}
중요한 참고 사항
- 업데이트는 메타데이터에만 영향을 미치며, 토큰 자체나 기존 잔액에는 영향을 미치지 않습니다
- 토큰이 불변으로 생성된 경우, 메타데이터를 업데이트할 수 없습니다
uri를 변경하면 이미지나 설명 같은 오프체인 데이터를 업데이트할 수 있습니다
