プログラム

アセットの更新

Last updated April 17, 2026

Summary

mplx core asset update コマンドは、MPL Core アセットのオンチェーン名、URI、画像、オフチェーンメタデータ、またはコレクションメンバーシップを変更します。

  • メタデータフィールドを個別 (--name--uri) または JSON ファイル (--offchain) から更新
  • --image で新しい画像をアップロードして割り当て
  • コレクションへのアセット追加、コレクション間の移動、コレクションからの削除
  • 呼び出し元がアセットの現在のアップデートオーソリティ(またはコレクションアセットの場合はコレクションのアップデートオーソリティ)である必要があります

Basic Usage

Update an asset
mplx core asset update <assetId> [options]

少なくとも 1 つの更新フラグを指定する必要があります。複数のフラグを 1 つのコマンドに組み合わせることができます。例えば、名前の更新とコレクションへの追加を同時に行えます。

Update Options

以下のフラグは、mplx core asset update コマンドがアセットに対して変更する内容を制御します。

FlagDescription
--name <string>アセットの新しい名前(--offchain と併用不可)
--uri <string>アセットメタデータの新しい URI(--offchain と併用不可)
--image <path>アップロードする新しい画像ファイルへのパス
--offchain <path>JSON メタデータファイルへのパス(--name または --uri と併用不可)
--collection <collectionId>アセットをコレクションに追加、または別のコレクションに移動(--remove-collection と併用不可)
--remove-collection現在のコレクションからアセットを削除(--collection と併用不可)

Global Flags

これらのフラグはすべての mplx core コマンドに適用され、CLI ランタイムを設定します。

FlagDescription
-c, --config <value>設定ファイルへのパス。デフォルトは ~/.config/mplx/config.json
-k, --keypair <value>キーペアファイルまたはレジャーへのパス(例:usb://ledger?key=0
-p, --payer <value>支払者キーペアファイルまたはレジャーへのパス
-r, --rpc <value>クラスターの RPC URL
--commitment <option>コミットメントレベル:processedconfirmed、または finalized
--json出力を JSON 形式でフォーマット
--log-level <option>ログレベル:debugwarnerrorinfo、または trace(デフォルト:info

Update Metadata

アセットの名前、URI、画像、またはオフチェーンメタデータを更新します。--offchain フラグはローカル JSON ファイルを読み込み、その name フィールドからオンチェーン名を同期します。--image フラグはファイルをアップロードし、メタデータ内の画像 URI を更新します。

1# Update name and URI
2mplx core asset update <assetId> --name "Updated Asset" --uri "https://example.com/metadata.json"
3
4# Update with a JSON metadata file
5mplx core asset update <assetId> --offchain ./asset/metadata.json
6
7# Update with a new image
8mplx core asset update <assetId> --image ./asset/image.jpg
9
10# Update with JSON metadata and image
11mplx core asset update <assetId> --offchain ./asset/metadata.json --image ./asset/image.jpg

Manage Collection Membership

--collection および --remove-collection フラグは、アセットが属するコレクションを制御します。これらのフラグは単独で使用することも、メタデータ更新フラグと組み合わせて 1 つのトランザクションで使用することもできます。

Add an Asset to a Collection

--collection フラグは、スタンドアロンのアセットをコレクションに割り当てます。アセットのアップデートオーソリティはアドレスからコレクションに変更されます。

1# Add a standalone asset to a collection
2mplx core asset update <assetId> --collection <collectionId>
3
4# Or use the convenience alias
5mplx core collection add <collectionId> <assetId>

Output:

✔ Asset added to collection (Tx: <transactionSignature>)

アセットをコレクションに追加するには、アセットと対象コレクションの両方のアップデートオーソリティである必要があります。

Move an Asset to a Different Collection

すでにコレクションに属しているアセットに同じ --collection フラグを使用します。CLI が既存のコレクションを検出し、アセットを新しいコレクションに移動します。

1# Move an asset from its current collection to a different one
2mplx core asset update <assetId> --collection <newCollectionId>

Output:

✔ Asset moved to new collection (Tx: <transactionSignature>)

アセットの現在のコレクションと対象コレクションの両方のアップデートオーソリティである必要があります。

Remove an Asset from a Collection

--remove-collection フラグは、アセットを現在のコレクションから切り離します。アセットのアップデートオーソリティはコレクションから署名者のアドレスに戻ります。

1# Remove an asset from its current collection
2mplx core asset update <assetId> --remove-collection

Output:

✔ Asset removed from collection (Tx: <transactionSignature>)

コレクションに属していないアセットに対して --remove-collection を実行するとエラーになります:

✖ Asset is not in a collection
Error: Cannot remove from collection: asset does not belong to a collection

コレクションフラグはメタデータフラグと 1 つのトランザクションで組み合わせることができます。例:mplx core asset update <assetId> --name "New Name" --collection <collectionId>

Output

メタデータ更新が成功すると、コマンドは以下を表示します:

--------------------------------
Asset: <assetId>
Signature: <transactionSignature>
Explorer: <explorerUrl>
Core Explorer: https://core.metaplex.com/explorer/<assetId>
--------------------------------

コレクションのみの操作では、出力は確認行 1 行です:

✔ Asset added to collection (Tx: <transactionSignature>)

構造化出力には --json を使用します:

JSON response
{
"asset": "<assetId>",
"signature": "<transactionSignature>",
"explorer": "<explorerUrl>"
}

Quick Reference

mplx core asset update のコマンド詳細、適用範囲、ソース場所を一目で確認できます。

ItemValue
Update commandmplx core asset update
Add-to-collection aliasmplx core collection add(コレクション追加のケースのみ対象。移動、削除、メタデータのみの更新には適用されません)
Applies toMPL Core Assets のみ — Token Metadata NFT には非対応
SourceGitHub — metaplex-foundation/cli

Notes

  • 少なくとも 1 つの更新フラグを指定する必要があります:--name--uri--image--offchain--collection、または --remove-collection
  • --name および --uri フラグは --offchain と併用できません
  • --collection および --remove-collection フラグは相互排他です
  • --offchain を使用する場合、JSON メタデータファイルには有効な name フィールドが含まれている必要があります — オンチェーン名はこれから同期されます
  • --image フラグはファイルをアップロードし、メタデータ内の画像 URI を自動的に更新します
  • コレクション操作はアセットのアップデートオーソリティを変更します:コレクションへの追加ではコレクションアドレスに設定され、削除では署名者のウォレットアドレスに戻ります
  • 呼び出し元は、いかなる更新を実行する場合もアセットのアップデートオーソリティ(またはコレクションアセットの場合はコレクションのアップデートオーソリティ)である必要があります
  • このコマンドは MPL Core Assets のみに適用されます — Token Metadata NFT の場合は別の更新命令を使用してください