機能
Core Collectionの更新
Last updated April 8, 2026
updateCollectionとupdateCollectionPluginは既存のCore Collectionのメタデータとプラグイン設定を変更します。
学習内容
- CollectionのnameまたはURIの更新
- Collectionに付与されたプラグインの更新
Summary
Core Collectionの作成後の更新には2つの命令があります。
updateCollection— collectionのnameまたはuriを変更するupdateCollectionPlugin— collectionの既存プラグインの設定を変更する- どちらも
updateAuthorityの署名が必要です - コレクションレベルのプラグインへの変更はそれを継承するメンバーAssetに伝播します
ジャンプ: メタデータの更新 · プラグインの更新 · エラー対処
前提条件
- CollectionのupdateAuthorityをsignerとして設定したUmi — この値を取得するにはCollectionの取得を参照
- 更新したいcollectionのアドレス
Collectionメタデータ更新
updateCollectionは既存Collectionのnameおよび/またはuriを変更します。変更したいフィールドのみ渡してください。
Core Collectionの更新
update-collection.ts
import { publicKey } from '@metaplex-foundation/umi'
import { updateCollection } from '@metaplex-foundation/mpl-core'
const collectionAddress = publicKey('1111111111111111111111111111111')
await updateCollection(umi, {
collection: collectionAddress,
name: 'My Updated Collection',
uri: 'https://example.com/new-uri.json',
}).sendAndConfirm(umi)
Collectionプラグイン更新
updateCollectionPluginはCollectionにすでに付与されているプラグインの設定を変更します。以下の例ではRoyaltiesプラグインのBasis pointsとクリエイター配分を更新しています。
Core Collectionプラグインの更新
update-collection-plugin.ts
import { publicKey } from '@metaplex-foundation/umi'
import { updateCollectionPlugin, ruleSet } from '@metaplex-foundation/mpl-core'
const collectionAddress = publicKey('1111111111111111111111111111111')
const newCreator = publicKey('5555555555555555555555555555555')
await updateCollectionPlugin(umi, {
collection: collectionAddress,
plugin: {
type: 'Royalties',
basisPoints: 400,
creators: [{ address: newCreator, percentage: 100 }],
ruleSet: ruleSet('None'),
},
}).sendAndConfirm(umi)
よくあるエラー
Authority mismatch
CollectionのupdateAuthorityとして署名していません。Collectionを取得して確認してください:
const collection = await fetchCollection(umi, collectionAddress)
console.log(collection.updateAuthority) // umi.identityと一致する必要があります
Notes
- Collectionにまだ存在しないプラグインを追加するには、
updateCollectionPluginではなくaddCollectionPluginを使用してください - コレクションレベルのプラグインを更新すると、それを継承するすべてのAssetに影響します — 同じタイプの自前プラグインを持つAssetは影響を受けません
updateCollectionのnewUpdateAuthorityパラメータでupdateAuthorityを新しいアカウントに移管できます
Quick Reference
| Instruction | JS関数 | 使用場面 |
|---|---|---|
UpdateCollectionV1 | updateCollection | nameまたはuriの変更 |
UpdateCollectionPluginV1 | updateCollectionPlugin | 既存プラグインの設定変更 |
| アカウント | 必須 | 説明 |
|---|---|---|
collection | Yes | 更新するCollection |
authority | Yes | updateAuthorityである必要がある |
payer | Yes | トランザクション手数料の支払い |
newUpdateAuthority | No | 新しいアカウントにUpdate Authorityを移管 |
