Plugins
Permanent Freeze Delegate
Overview
The Permanent Freeze Delegate plugin is a Permanent
plugin that will always be present on the MPL Core Asset or MPL Core Collection to which it is added. A permanent plugin can only be added at the time of Asset or Collection creation.
The Permanent Freeze Plugin will work in areas such as:
- Soulbound Tokens.
Works With
MPL Core Asset | ✅ |
MPL Core Collection | ✅ |
Behaviours
- Asset: Allows the delegated address to freeze and thaw the NFT at any time.
- Collection: Allows the collection authority to freeze and thaw the whole collection at once. It does not allow to freeze a single asset in the collection using this delegate.
Arguments
Arg | Value |
---|---|
frozen | bool |
Creating an Asset with a Permanent Freeze plugin
The following example shows how to create an Asset with a Permanent Freeze plugin.
Creating an Asset with a Permanent Freeze plugin
import { publicKey } from '@metaplex-foundation/umi'
import { create } from '@metaplex-foundation/mpl-core'
const assetSigner = generateSigner(umi)
const delegate = publicKey('33333333333333333333333333333')
await create(umi, {
asset: assetSigner,
name: 'My NFT',
uri: 'https://example.com/my-asset.json',
plugins: [
{
type: 'PermanentFreezeDelegate',
frozen: true,
authority: { type: 'Address', address: delegate },
},
],
}).sendAndConfirm(umi)
Updating the Permanent Freeze Delegate plugin on an Asset
The following example shows how to update the Permanent Freeze Delegate plugin on an Asset. Freeze or unfreeze it by setting the frozen
argument to true
or false
respectively. It assumes that the signing wallet is the plugin authority.
Updating the Permanent Freeze Delegate plugin on an Asset
import { updatePlugin } from '@metaplex-foundation/mpl-core'
const updateAssetResponse = await updatePlugin(umi, {
asset: asset.publicKey,
plugin: {
type: "PermanentFreezeDelegate",
frozen: false,
},
}).sendAndConfirm(umi);
Creating a Collection with a Permanent Freeze plugin
The following example shows how to create a collection with a Permanent Freeze plugin.
Creating a Collection with a Permanent Freeze plugin
import { generateSigner } from '@metaplex-foundation/umi'
import { createCollection } from '@metaplex-foundation/mpl-core'
const collectionSigner = generateSigner(umi)
await createCollection(umi, {
collection: collectionSigner,
name: "Frozen Collection",
uri: "https://example.com/my-collection.json",
plugins: [
{
type: 'PermanentFreezeDelegate',
frozen: true,
authority: { type: "UpdateAuthority"}, // The update authority can unfreeze it
},
],
}).sendAndConfirm(umi);
Updating a Collection with a Permanent Freeze plugin
The following example shows how to update the Permanent Freeze Delegate plugin on a Collection. Freeze or unfreeze it by setting the frozen
argument to true
or false
respectively. It assumes that the signing wallet is the plugin authority.
Updating a Collection with a Permanent Freeze plugin
import { updateCollectionPlugin } from '@metaplex-foundation/mpl-core'
const updateCollectionResponse = await updateCollectionPlugin(umi, {
collection: collectionSigner.publicKey,
plugin: {
type: "PermanentFreezeDelegate",
frozen: false,
},
}).sendAndConfirm(umi);