機能
Assetの更新
Last updated January 31, 2026
このガイドでは、Metaplex Core SDKを使用してSolanaでCore Assetメタデータを更新する方法を説明します。管理するAssetの名前、URI、またはコレクションメンバーシップを変更できます。
学習内容
- Asset名とメタデータURIの更新
- Assetを別のCollectionに移動
- Assetを不変(永続的)にする
- Update Authority要件の理解
概要
update命令を使用してCore Assetのメタデータを更新します。Update Authority(または承認されたデリゲート)のみがAssetを変更できます。
nameとuriを変更してメタデータを更新newCollectionを使用してCollection間でAssetを移動updateAuthorityをNoneに設定して不変にする- アカウントサイズを変更しない限り、更新は無料(レントコストなし)
スコープ外
Token Metadata NFTの更新(mpl-token-metadataを使用)、プラグインの変更(プラグインを参照)、所有権の転送(Assetの転送を参照)。
クイックスタート
ジャンプ先: Asset更新 · Collection変更 · 不変化
- インストール:
npm install @metaplex-foundation/mpl-core @metaplex-foundation/umi - 現在の状態を取得するためにAssetをフェッチ
- 新しい値で
update(umi, { asset, name, uri })を呼び出す fetchAsset()で変更を確認
前提条件
- AssetのUpdate Authorityである署名者が設定されたUmi
- 更新するAssetアドレス
- Arweave/IPFSにアップロードされた新しいメタデータ(URIを変更する場合) Core AssetのUpdate Authorityまたはデリゲートは、Assetのデータの一部を変更する権限を持っています。
Core Assetの更新
SDKを使用してMPL Core Assetを更新する方法は以下の通りです。
1import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
2import { update } from '@metaplex-foundation/mpl-core'
3import { mplCore } from '@metaplex-foundation/mpl-core'
4import { publicKey } from '@metaplex-foundation/umi'
5
6const umi = createUmi('https://api.devnet.solana.com').use(mplCore())
7const assetAddress = publicKey('AssetAddressHere...')
8
9// Update an existing NFT asset's metadata
10const result = await update(umi, {
11 asset: assetAddress,
12 name: 'Updated NFT Name',
13 uri: 'https://updated-example.com/metadata.json',
14}).sendAndConfirm(umi)
15
16console.log('Asset updated successfully')
Core AssetのCollection変更
SDKを使用してCore AssetのCollectionを変更する方法は以下の通りです。
Core AssetのCollection変更
import { publicKey } from "@metaplex-foundation/umi";
import {
update,
fetchAsset,
fetchCollection,
collectionAddress,
updateAuthority
} from "@metaplex-foundation/mpl-core";
const assetId = publicKey("11111111111111111111111111111111");
const asset = await fetchAsset(umi, assetId);
const collectionId = collectionAddress(asset)
if (!collectionId) {
console.log("Collection not found");
return;
}
const collection = await fetchCollection(umi, collectionId);
const newCollectionId = publicKey("22222222222222222222222222222222")
const updateTx = await update(umi, {
asset,
collection,
newCollection: newCollectionId,
newUpdateAuthority: updateAuthority('Collection', [newCollectionId]),
}).sendAndConfirm(umi);
Core Assetデータの不変化
SDKを使用してCore Assetを完全に不変にする方法は以下の通りです。不変性ガイドで説明されている異なるレベルの不変性があることに注意してください。
重要
これは破壊的なアクションであり、Assetを更新する機能が削除されます。 また、Assetが属していたすべてのCollectionからも削除されます。Collection Assetを不変にするには、CollectionのUpdate Authorityを変更する必要があります。
Core Assetを不変にする
import { publicKey } from '@metaplex-foundation/umi'
import { update, fetchAsset } from '@metaplex-foundation/mpl-core'
const assetId = publicKey('11111111111111111111111111111111')
const asset = await fetchAsset(umi, asset)
await update(umi, {
asset: asset,
newUpdateAuthority: updateAuthority('None'),
}).sendAndConfirm(umi)
よくあるエラー
Authority mismatch
あなたはAssetのUpdate Authorityではありません。確認してください:
const asset = await fetchAsset(umi, assetAddress)
console.log(asset.updateAuthority) // 署名者と一致する必要があります
Collection authority required
Collectionを変更する場合、AssetとターゲットのCollection両方で権限が必要です。
Asset is immutable
AssetのUpdate AuthorityがNoneに設定されています。これは元に戻せません。
注意事項
- 更新前にAssetをフェッチして現在の状態を確認する
- Update Authority(またはデリゲート)のみがAssetを更新できる
- Assetを不変にすることは永続的で元に戻せない
- Collectionを変更すると継承されたプラグイン(ロイヤリティなど)に影響する可能性がある
- 更新によってAssetの所有者は変わらない
クイックリファレンス
更新パラメータ
| パラメータ | 説明 |
|---|---|
asset | 更新するAsset(アドレスまたはフェッチされたオブジェクト) |
name | Assetの新しい名前 |
uri | 新しいメタデータURI |
newCollection | ターゲットCollectionアドレス |
newUpdateAuthority | 新しいAuthority(または不変の場合はNone) |
Authorityタイプ
| タイプ | 説明 |
|---|---|
Address | 特定の公開鍵 |
Collection | CollectionのUpdate Authority |
None | 不変 - 更新不可 |
FAQ
Assetを不変にした後、元に戻せますか?
いいえ。Update AuthorityをNoneに設定することは永続的です。Assetの名前、URI、コレクションメンバーシップは永久に固定されます。確実な場合のみ行ってください。
URIを変更せずに名前だけを更新するにはどうすればよいですか?
変更したいフィールドのみを渡します。現在の値を維持するにはuriを省略してください:
await update(umi, { asset, name: 'New Name' }).sendAndConfirm(umi)
更新と転送の違いは何ですか?
更新はAssetのメタデータ(名前、URI)を変更します。転送は所有権を変更します。それぞれ異なる権限要件を持つ別々の操作です。
デリゲートはAssetを更新できますか?
はい、Update Delegateプラグインを通じてUpdate Delegateとして割り当てられている場合は可能です。
更新にSOLはかかりますか?
新しいデータが現在のアカウントサイズより大きい場合(まれ)を除き、更新は無料です。トランザクション手数料(約0.000005 SOL)は引き続き適用されます。
用語集
| 用語 | 定義 |
|---|---|
| Update Authority | Assetのメタデータを変更する権限を持つアカウント |
| 不変(Immutable) | 更新できないAsset(Update AuthorityがNone) |
| URI | オフチェーンメタデータJSONを指すURL |
| デリゲート | プラグインを通じて特定の権限を付与されたアカウント |
| コレクションメンバーシップ | Assetが属するCollection |
