Skip to content

NFT โ€‹

Calls โ€‹

burn โ€‹

Burn a token ๐Ÿ”ฅ

Caller must be the token owner

Namespace

api.tx.nft.burn

Type

function burn(
  token_id: (u32,u32)
)

claimUnownedCollection โ€‹

Bridged collections from Ethereum will initially lack an owner. These collections will be assigned to the pallet. This allows for claiming those collections assuming they were assigned to the pallet

Namespace

api.tx.nft.claimUnownedCollection

Type

function claimUnownedCollection(
  collection_id: u32,
  new_owner: SeedPrimitivesSignatureAccountId20
)

createCollection โ€‹

Create a new collection Additional tokens can be minted via mint

  • name - the name of the collection
  • initial_issuance - number of tokens to mint now
  • max_issuance - maximum number of tokens allowed in collection
  • token_owner - the token owner, defaults to the caller
  • metadata_scheme - The off-chain metadata referencing scheme for tokens in this
  • royalties_schedule - defacto royalties plan for secondary sales, this will apply to all tokens in the collection by default
  • cross_chain_compatibility - Is this collection XLS-20 compatible. Note, if enabled, the metadata_scheme will be immutable

Namespace

api.tx.nft.createCollection

Type

function createCollection(
  name: Bytes,
  initial_issuance: u32,
  max_issuance: Option<u32>,
  token_owner: Option<SeedPrimitivesSignatureAccountId20>,
  metadata_scheme: Bytes,
  royalties_schedule: Option<SeedPrimitivesNftRoyaltiesSchedule>,
  cross_chain_compatibility: PalletNftCrossChainCompatibility
)

mint โ€‹

Mint tokens for an existing collection

  • collection_id - the collection to mint tokens in
  • quantity - how many tokens to mint
  • token_owner - the token owner, defaults to the caller if unspecified Caller must be the collection owner

Namespace

api.tx.nft.mint

Type

function mint(
  collection_id: u32,
  quantity: u32,
  token_owner: Option<SeedPrimitivesSignatureAccountId20>
)

setBaseUri โ€‹

Set the base URI of a collection Caller must be the current collection owner.\

Cannot change if XLS20 compatibility is enabled.

Namespace

api.tx.nft.setBaseUri

Type

function setBaseUri(
  collection_id: u32,
  base_uri: Bytes
)

setMaxIssuance โ€‹

Set the max issuance of a collection Caller must be the current collection owner

Namespace

api.tx.nft.setMaxIssuance

Type

function setMaxIssuance(
  collection_id: u32,
  max_issuance: u32
)

setMintFee โ€‹

Namespace

api.tx.nft.setMintFee

Type

function setMintFee(
  collection_id: u32,
  pricing_details: Option<(u32,u128)>
)

setName โ€‹

Set the name of a collection Caller must be the current collection owner

Namespace

api.tx.nft.setName

Type

function setName(
  collection_id: u32,
  name: Bytes
)

setOwner โ€‹

Set the owner of a collection Caller must be the current collection owner

Namespace

api.tx.nft.setOwner

Type

function setOwner(
  collection_id: u32,
  new_owner: SeedPrimitivesSignatureAccountId20
)

setRoyaltiesSchedule โ€‹

Set the royalties schedule of a collection Caller must be the current collection owner

Namespace

api.tx.nft.setRoyaltiesSchedule

Type

function setRoyaltiesSchedule(
  collection_id: u32,
  royalties_schedule: SeedPrimitivesNftRoyaltiesSchedule
)

togglePublicMint โ€‹

Namespace

api.tx.nft.togglePublicMint

Type

function togglePublicMint(
  collection_id: u32,
  enabled: bool
)

transfer โ€‹

Transfer ownership of an NFT Caller must be the token owner

Namespace

api.tx.nft.transfer

Type

function transfer(
  collection_id: u32,
  serial_numbers: Vec<u32>,
  new_owner: SeedPrimitivesSignatureAccountId20
)

setUtilityFlags โ€‹

Set utility flags of a collection. Allows the restriction of certain operations on a collection such as transfer, burn or mint. Flags apply to all tokens in the collection, but individual token flags take priority over collection flags.

  • collection_id - The collection to set the utility flags for

  • utility_flags - An object containing the utility flags.

    CollectionUtilityFlags {
      transferable: bool,
      burnable: bool,
      mintable: bool,
    }

Namespace

api.tx.nft.setUtilityFlags

Type

function setUtilityFlags(
  collection_id: u32,
  utility_flags: CollectionUtilityFlags,
)

setTokenTransferableFlag โ€‹

Set transferable flag on a token, allowing or disallowing transfers. Token utility flags take priority over the collection utility flags, enabling fine-grained control over individual token transferability.

Priority Order:

  1. Token-level flags (highest priority)
  2. Collection-level flags (fallback)
  • token_id - The token id (collection_id, serial_number) to set the flags for
  • transferable - Whether the token should be transferable

Note: Soulbound tokens cannot have their utility flags modified after issuance.

Namespace

api.tx.nft.setTokenTransferableFlag

Type

function setTokenTransferableFlag(
  token_id: (u32,u32),
  transferable: bool
)

issueSoulbound โ€‹

Issue soulbound tokens. The issuance will be pending until the designated token owner accepts the issuance.

Soulbound tokens will always be non-transferable.

  • collection_id - The collection id to create the issuance for

  • quantity - The number of tokens to issue

  • token_owner - Account id of the token owner

  • burn_authority - The token burn authority. This value will dictate which account is allowed to burn the token, and cannot be altered post-issuance.

    TokenBurnAuthority {
      /// The token can be burned by the collection_owner
      CollectionOwner,
      /// The token can be burned by the token_owner
      TokenOwner,
      /// The token can be burned by either token or collection owner
      Both,
      /// The token cannot be burned by anyone
      Neither,
    }

Namespace

api.tx.nft.issueSoulbound

Type

function issueSoulbound(
  collection_id: u32,
  quantity: u32,
  token_owner: SeedPrimitivesSignatureAccountId20,
  burn_authority: TokenBurnAuthority
)

acceptSoulboundIssuance โ€‹

Accept the issuance of a soulbound token

  • collection_id - The collection id the issuance is for
  • issuance_id - The issuance id. An issuance id is created and emitted when a soulbound token is issued. All pending issuances for an account can be retrieved by querying the collection's pending issuances.

Namespace

api.tx.nft.acceptSoulboundIssuance

Type

function acceptSoulboundIssuance(
  collection_id: u32,
  issuance_id: u32,
)

setAdditionalData โ€‹

Sets additional data for a token. This allows storing extra information for a token outside the collection metadata.

  • token_id - The token id (collection_id, serial_number) to set data for
  • additional_data - Optional additional data. Pass None to remove existing data

Namespace

api.tx.nft.setAdditionalData

Type

function setAdditionalData(
  token_id: (u32,u32),
  additional_data: Option<Bytes>
)

mintWithAdditionalData โ€‹

Mint a single token alongside some additional data. This is equivalent to calling mint followed by setAdditionalData, but more efficient.

  • collection_id - The collection to mint the token in
  • token_owner - The token owner, defaults to the caller if unspecified
  • additional_data - Additional data to store with the token

Namespace

api.tx.nft.mintWithAdditionalData

Type

function mintWithAdditionalData(
  collection_id: u32,
  token_owner: Option<SeedPrimitivesSignatureAccountId20>,
  additional_data: Bytes
)

Storage โ€‹

collectionInfo โ€‹

Map from collection to its information

Namespace

api.query.nft.collectionInfo

Type

function collectionInfo(
  u32
): Option<PalletNftCollectionInformation>

tokenInfo โ€‹

Map from a token to its information, including owner, lock status and utility flags

Namespace

api.query.nft.tokenInfo

Type

type TokenInformation = {
  owner: SeedPrimitivesSignatureAccountId20,
  lock_status: Option<SeedPrimitivesNftTokenLockReason>,
  utility_flags: {
    transferable: bool,
    burn_authority: Option<TokenBurnAuthority>
  }
}

function tokenInfo(
  collection_id: u32,
  serial_number: u32
): Option<TokenInformation>

ownedTokens โ€‹

All tokens owned by a single account, organized by collection

Namespace

api.query.nft.ownedTokens

Type

function ownedTokens(
  account_id: SeedPrimitivesSignatureAccountId20,
  collection_id: u32
): Vec<u32>

nextCollectionId โ€‹

The next available incrementing collection id

Namespace

api.query.nft.nextCollectionId

Type

function nextCollectionId(

): u32

publicMintInfo โ€‹

Map from collection to its public minting information

Namespace

api.query.nft.publicMintInfo

Type

function publicMintInfo(
  u32
): Option<SeedPalletCommonUtilsPublicMintInformation>

utilityFlags โ€‹

Map from a collection id to its utility flags. These flags control operations at the collection level and apply to all tokens unless overridden by token-specific flags.

Namespace

api.query.nft.utilityFlags

Type

type CollectionUtilityFlags = {
  transferable: bool,
  burnable: bool,
  mintable: bool,
}

function utilityFlags(u32): CollectionUtilityFlags

additionalTokenData โ€‹

Map from a token_id to additional token data. Useful for assigning extra information to a token outside the collection metadata.

Namespace

api.query.nft.additionalTokenData

Type

function additionalTokenData(
  (u32, u32)
): Bytes

tokenUtilityFlags โ€‹

Map from a token id to its utility flags. Token-level flags take priority over collection-level flags, allowing fine-grained control over individual tokens.

Namespace

api.query.nft.tokenUtilityFlags

Type

type TokenUtilityFlags = {
  transferable: bool,
  burnAuthority: Option<TokenBurnAuthority>,
}

function tokenUtilityFlags(
  (u32, u32)
): TokenUtilityFlags

pendingIssuances โ€‹

Map from a collection id to the collection's pending issuances

Namespace

api.query.nft.pendingIssuances

Type

type PendingIssuance = {
  issuanceId: u32;
  quantity: u32;
  burnAuthority: TokenBurnAuthority;
}

type CollectionPendingIssuances = {
  nextIssuanceId: u32;
  pendingIssuances: Vec<(AccountId, PendingIssuance)>;
}

function pendingIssuances(
  u32
): CollectionPendingIssuances

Can be used to retrieve pending issuances for a particular account.

const collectionIssuances = await api.query.nft.pendingIssuances(collectionId);
const pendingIssuances =
  collectionIssuances.
    pendingIssuances.
    toJSON().
    find((p) => p[0] === accountId);

Events โ€‹

BaseUriSet โ€‹

Base URI was set

Namespace

api.events.nft.BaseUriSet

Type

type BaseUriSet = {
  collection_id: u32,
  base_uri: Bytes
}

BridgedMint โ€‹

Token(s) were bridged

Namespace

api.events.nft.BridgedMint

Type

type BridgedMint = {
  collection_id: u32,
  serial_numbers: Vec<u32>,
  owner: SeedPrimitivesSignatureAccountId20
}

Burn โ€‹

A token was burned

Namespace

api.events.nft.Burn

Type

type Burn = {
  token_owner: SeedPrimitivesSignatureAccountId20,
  collection_id: u32,
  serial_number: u32
}

CollectionClaimed โ€‹

Collection has been claimed

Namespace

api.events.nft.CollectionClaimed

Type

type CollectionClaimed = {
  account: SeedPrimitivesSignatureAccountId20,
  collection_id: u32
}

CollectionCreate โ€‹

A new collection of tokens was created

Namespace

api.events.nft.CollectionCreate

Type

type CollectionCreate = {
  collection_uuid: u32,
  initial_issuance: u32,
  max_issuance: Option<u32>,
  collection_owner: SeedPrimitivesSignatureAccountId20,
  metadata_scheme: Bytes,
  name: Bytes,
  royalties_schedule: Option<SeedPrimitivesNftRoyaltiesSchedule>,
  origin_chain: SeedPrimitivesNftOriginChain,
  compatibility: PalletNftCrossChainCompatibility
}

MaxIssuanceSet โ€‹

Max issuance was set

Namespace

api.events.nft.MaxIssuanceSet

Type

type MaxIssuanceSet = {
  collection_id: u32,
  max_issuance: u32
}

Mint โ€‹

Token(s) were minted

Namespace

api.events.nft.Mint

Type

type Mint = {
  collection_id: u32,
  start: u32,
  end: u32,
  owner: SeedPrimitivesSignatureAccountId20
}

MintFeePaid โ€‹

Payment was made to cover a public mint

Namespace

api.events.nft.MintFeePaid

Type

type MintFeePaid = {
  who: SeedPrimitivesSignatureAccountId20,
  collection_id: u32,
  payment_asset: u32,
  payment_amount: u128,
  token_count: u32
}

MintPriceSet โ€‹

A mint price was set for a collection

Namespace

api.events.nft.MintPriceSet

Type

type MintPriceSet = {
  collection_id: u32,
  payment_asset: Option<u32>,
  mint_price: Option<u128>
}

NameSet โ€‹

Name was set

Namespace

api.events.nft.NameSet

Type

type NameSet = {
  collection_id: u32,
  name: Bytes
}

OwnerSet โ€‹

A new owner was set

Namespace

api.events.nft.OwnerSet

Type

type OwnerSet = {
  collection_id: u32,
  new_owner: SeedPrimitivesSignatureAccountId20
}

PublicMintToggle โ€‹

Public minting was enabled/disabled for a collection

Namespace

api.events.nft.PublicMintToggle

Type

type PublicMintToggle = {
  collection_id: u32,
  enabled: bool
}

RoyaltiesScheduleSet โ€‹

Royalties schedule was set

Namespace

api.events.nft.RoyaltiesScheduleSet

Type

type RoyaltiesScheduleSet = {
  collection_id: u32,
  royalties_schedule: SeedPrimitivesNftRoyaltiesSchedule
}

Transfer โ€‹

A token was transferred

Namespace

api.events.nft.Transfer

Type

type Transfer = {
  previous_owner: SeedPrimitivesSignatureAccountId20,
  collection_id: u32,
  serial_numbers: Vec<u32>,
  new_owner: SeedPrimitivesSignatureAccountId20
}

UtilityFlagsSet โ€‹

Utility flags were set for a collection

Namespace

api.events.nft.UtilityFlagsSet

Type

type UtilityFlagsSet = {
  collection_id: u32,
  utility_flags: CollectionUtilityFlags
}

TokenTransferableFlagSet โ€‹

Token transferable flag was set

Namespace

api.events.nft.TokenTransferableFlagSet

Type

type TokenTransferableFlagSet = {
  token_id: (u32, u32),
  transferable: bool
}

PendingIssuanceCreated โ€‹

A pending issuance for a soulbound token was created

Namespace

api.events.nft.PendingIssuanceCreated

Type

type PendingIssuanceCreated = {
  collection_id: u32,
  issuance_id: u32,
  token_owner: SeedPrimitivesSignatureAccountId20,
  quantity: u32,
  burn_authority: TokenBurnAuthority,
}

Issued โ€‹

Soulbound tokens were successfully issued

Namespace

api.events.nft.Issued

Type

type Issued = {
  token_owner: SeedPrimitivesSignatureAccountId20,
  start: u32,
  end: u32,
  burn_authority: TokenBurnAuthority,
}

AdditionalDataSet โ€‹

Some additional data has been set for a token

Namespace

api.events.nft.AdditionalDataSet

Type

type AdditionalDataSet = {
  token_id: (u32, u32),
  additional_data: Option<Bytes>,
}

Errors โ€‹

AttemptedMintOnBridgedToken โ€‹

Attemped to mint a token that was bridged from a different chain

Namespace

api.errors.nft.AttemptedMintOnBridgedToken

BlockedMint โ€‹

Token(s) blocked from minting during the bridging process

Namespace

api.errors.nft.BlockedMint

CannotClaimNonClaimableCollections โ€‹

Cannot claim already claimed collections

Namespace

api.errors.nft.CannotClaimNonClaimableCollections

CannotUpdateMetadata โ€‹

Only Root originated NFTs that are not XLS-20 compatible can have their metadata updated

Namespace

api.errors.nft.CannotUpdateMetadata

CollectionIssuanceNotZero โ€‹

Total issuance of collection must be zero to add xls20 compatibility

Namespace

api.errors.nft.CollectionIssuanceNotZero

MintUtilityBlocked โ€‹

Minting has been disabled for tokens within this collection

Namespace

api.errors.nft.MintUtilityBlocked

CollectionNameInvalid โ€‹

Given collection name is invalid (invalid utf-8, too long, empty)

Namespace

api.errors.nft.CollectionNameInvalid

InitialIssuanceNotZero โ€‹

Initial issuance on XLS-20 compatible collections must be zero

Namespace

api.errors.nft.InitialIssuanceNotZero

InvalidMaxIssuance โ€‹

Max issuance needs to be greater than 0 and initial_issuance Cannot exceed MaxTokensPerCollection

Namespace

api.errors.nft.InvalidMaxIssuance

InvalidMetadataPath โ€‹

The metadata path is invalid (non-utf8 or empty)

Namespace

api.errors.nft.InvalidMetadataPath

InvalidNewOwner โ€‹

The caller can not be the new owner

Namespace

api.errors.nft.InvalidNewOwner

InvalidAdditionalData โ€‹

The additional data cannot be an empty vec

Namespace

api.errors.nft.InvalidAdditionalData

MaxIssuanceAlreadySet โ€‹

The max issuance has already been set and can't be changed

Namespace

api.errors.nft.MaxIssuanceAlreadySet

MaxIssuanceReached โ€‹

The collection max issuance has been reached and no more tokens can be minted

Namespace

api.errors.nft.MaxIssuanceReached

MintLimitExceeded โ€‹

The quantity exceeds the max tokens per mint limit

Namespace

api.errors.nft.MintLimitExceeded

NoAvailableIds โ€‹

No more Ids are available, they've been exhausted

Namespace

api.errors.nft.NoAvailableIds

NoCollectionFound โ€‹

The collection does not exist

Namespace

api.errors.nft.NoCollectionFound

NotCollectionOwner โ€‹

Origin is not the collection owner and is not permitted to perform the operation

Namespace

api.errors.nft.NotCollectionOwner

NoToken โ€‹

The token does not exist

Namespace

api.errors.nft.NoToken

NotTokenOwner โ€‹

Origin does not own the NFT

Namespace

api.errors.nft.NotTokenOwner

PublicMintDisabled โ€‹

This collection has not allowed public minting

Namespace

api.errors.nft.PublicMintDisabled

RoyaltiesInvalid โ€‹

Total royalties would exceed 100% of sale or an empty vec is supplied

Namespace

api.errors.nft.RoyaltiesInvalid

TokenLimitExceeded โ€‹

The number of tokens have exceeded the max tokens allowed

Namespace

api.errors.nft.TokenLimitExceeded

TokenLocked โ€‹

Cannot operate on a listed NFT

Namespace

api.errors.nft.TokenLocked

TransferUtilityBlocked โ€‹

Transfer has been disabled for tokens within this collection

Namespace

api.errors.nft.TransferUtilityBlocked

BurnUtilityBlocked โ€‹

Burning has been disabled for tokens within this collection

Namespace

api.errors.nft.BurnUtilityBlocked

PendingIssuanceLimitExceeded โ€‹

The number of pending issuances has exceeded the max for a collection

Namespace

api.errors.nft.PendingIssuanceLimitExceeded

InvalidPendingIssuance โ€‹

Attempted to accept an issuance that does not exist, or is not set for the caller

Namespace

api.errors.nft.InvalidPendingIssuance

CannotUpdateTokenUtility โ€‹

Attempted to update the token utility flags for a soulbound token

Namespace

api.errors.nft.CannotUpdateTokenUtility

InvalidBurnAuthority โ€‹

Attempted to burn a token from an account that does not adhere to the token's burn authority

Namespace

api.errors.nft.InvalidBurnAuthority

SerialNumbersNotUnique โ€‹

The SerialNumbers attempting to be transferred are not unique

Namespace

api.errors.nft.SerialNumbersNotUnique

Constants โ€‹

palletId โ€‹

This pallet's Id, used for deriving a sovereign account ID

Namespace

api.consts.nft.palletId

Type

type palletId = FrameSupportPalletId

stringLimit โ€‹

The maximum length of a collection name, stored on-chain

Namespace

api.consts.nft.stringLimit

Type

type stringLimit = u32

JSON-RPC Methods โ€‹

ownedTokens โ€‹

Get all NFTs owned by an account

Interface

api.rpc.nft.ownedTokens(collectionId: CollectionUuid, who: AccountId, cursor: SerialNumber, limit: u16): Json

JSON

{ "id":1, "jsonrpc":"2.0", "method":"nft_ownedTokens", "params":[collectionId: CollectionUuid, who: AccountId, cursor: SerialNumber, limit: u16] }

tokenUri โ€‹

Get the URI of a token

Interface

api.rpc.nft.tokenUri(tokenId: TokenId): Json

JSON

{ "id":1, "jsonrpc":"2.0", "method":"nft_tokenUri", "params":[tokenId: TokenId] }

collectionDetails โ€‹

Get information related to a collection such as name, owner and max issuance

Interface

api.rpc.nft.collectionDetails(collectionId: CollectionUuid): Json

JSON

{ "id":1, "jsonrpc":"2.0", "method":"nft_collectionDetails", "params":[collectionId: CollectionUuid] }

Curated independently by Codeology. Source-attributed reference for The Root Network. Not affiliated with Futureverse / TRN Labs.