Plugins
Edition Plugin
The Edition Plugin is a Authority Managed
plugin that stores an Edition Number within the asset. Together with the soon to be added Master Edition Plugin those Editions could be compared to the Edition concept in Metaplex Token Metadata.
The Edition Plugin will work in areas such as:
- Prints of the same Asset
Intended Usage
We recommend to
- Group the Editions using the Master Edition Plugin
- use Candy Machine with the Edition Guard to handled numbering automatically.
Works With
MPL Core Asset | ✅ |
MPL Core Collection | ❌ |
Arguments
Arg | Value |
---|---|
number | number |
The number is a specific value that is assigned to the asset. Usually this number is unique, therefore the Creator should make sure that a number is not used twice.
Creating an Asset with the editions plugin
The Editions Plugin must be added on creation of the asset. As long as it is mutable the number can be changed.
Create with a mutable Plugin
Creating an MPL Core Asset with the Edition Plugin
import { publicKey } from '@metaplex-foundation/umi'
import { create } from '@metaplex-foundation/mpl-core'
const assetSigner = generateSigner(umi)
const result = create(umi, {
asset: assetSigner,
name: 'My Asset',
uri: 'https://example.com/my-asset.json',
plugins: [
{
type: 'Edition',
number: 1
},
],
}).sendAndConfirm(umi)
Create with a Immutable Plugin
To create the Asset with immutable Edition Plugin the following code can be used:
Adding the Editions Plugin to an MPL Core Asset
To have the editions Plugin immutable the authority has to be set to nonePluginAuthority()
like this:
import { publicKey } from '@metaplex-foundation/umi'
import { create } from '@metaplex-foundation/mpl-core'
const asset = generateSigner(umi)
const result = create(umi, {
asset: asset,
name: 'My Nft',
uri: 'https://example.com/my-nft',
plugins: [
{
type: 'Edition',
number: 1,
authority: { type: 'None' },
},
],
}).sendAndConfirm(umi)
Update the Editions Plugin
If the Editions Plugin is mutable it can be updated similar to other Plugins:
Update The Edition Plugin on an Asset
import { publicKey } from '@metaplex-foundation/umi'
import { updatePlugin } from '@metaplex-foundation/mpl-core'
const asset = publicKey('11111111111111111111111111111111')
await updatePlugin(umi, {
asset: assetAccount.publicKey,
plugin: { type: 'Edition', number: 2 },
}).sendAndConfirm(umi);