Skip to main content

remove

Removes an extension from an asset.

Accounts

Below is the list of accounts expected by the remove instruction.

NameWritableSignerOptionalDescription
assetUninitialized asset account
authorityAuthority of the asset
groupGroup asset account of the asset
recipientAccount paying for the storage fees

The recipient is the address that receives the refunded rent from the extension allocation.

Arguments

The remove instruction expects the information of the extension to remove.

FieldOffsetSizeDescription
extension type01Type of the extension.

The type of the extension is defined by one of the values of the ExtensionType enum.

info

It is not possible to remove a Manager or Proxy entensions. A Grouping extension can only be removed if the group is empty — its size is 0.

Examples

import { remove, ExtensionType } from '@nifty-oss/asset';

// Accounts:
// - asset: PublicKey
// - authority: KeypairSigner
// - recipient: PublicKey
await remove(umi, {
asset,
authority,
recipient,
extensionType: ExtensionType.Attributes,
}).sendAndConfirm(umi);