NFT โ
Calls โ
burn โ
Burn a token ๐ฅ
Caller must be the token owner
Namespace
api.tx.nft.burnType
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.claimUnownedCollectionType
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 collectioninitial_issuance- number of tokens to mint nowmax_issuance- maximum number of tokens allowed in collectiontoken_owner- the token owner, defaults to the callermetadata_scheme- The off-chain metadata referencing scheme for tokens in thisroyalties_schedule- defacto royalties plan for secondary sales, this will apply to all tokens in the collection by defaultcross_chain_compatibility- Is this collection XLS-20 compatible. Note, if enabled, the metadata_scheme will be immutable
Namespace
api.tx.nft.createCollectionType
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 inquantity- how many tokens to minttoken_owner- the token owner, defaults to the caller if unspecified Caller must be the collection owner
Namespace
api.tx.nft.mintType
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.setBaseUriType
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.setMaxIssuanceType
function setMaxIssuance(
collection_id: u32,
max_issuance: u32
)setMintFee โ
Namespace
api.tx.nft.setMintFeeType
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.setNameType
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.setOwnerType
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.setRoyaltiesScheduleType
function setRoyaltiesSchedule(
collection_id: u32,
royalties_schedule: SeedPrimitivesNftRoyaltiesSchedule
)togglePublicMint โ
Namespace
api.tx.nft.togglePublicMintType
function togglePublicMint(
collection_id: u32,
enabled: bool
)transfer โ
Transfer ownership of an NFT Caller must be the token owner
Namespace
api.tx.nft.transferType
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 forutility_flags- An object containing the utility flags.CollectionUtilityFlags { transferable: bool, burnable: bool, mintable: bool, }
Namespace
api.tx.nft.setUtilityFlagsType
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:
- Token-level flags (highest priority)
- Collection-level flags (fallback)
token_id- The token id (collection_id, serial_number) to set the flags fortransferable- Whether the token should be transferable
Note: Soulbound tokens cannot have their utility flags modified after issuance.
Namespace
api.tx.nft.setTokenTransferableFlagType
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 forquantity- The number of tokens to issuetoken_owner- Account id of the token ownerburn_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.issueSoulboundType
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 forissuance_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.acceptSoulboundIssuanceType
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 foradditional_data- Optional additional data. PassNoneto remove existing data
Namespace
api.tx.nft.setAdditionalDataType
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 intoken_owner- The token owner, defaults to the caller if unspecifiedadditional_data- Additional data to store with the token
Namespace
api.tx.nft.mintWithAdditionalDataType
function mintWithAdditionalData(
collection_id: u32,
token_owner: Option<SeedPrimitivesSignatureAccountId20>,
additional_data: Bytes
)Storage โ
collectionInfo โ
Map from collection to its information
Namespace
api.query.nft.collectionInfoType
function collectionInfo(
u32
): Option<PalletNftCollectionInformation>tokenInfo โ
Map from a token to its information, including owner, lock status and utility flags
Namespace
api.query.nft.tokenInfoType
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.ownedTokensType
function ownedTokens(
account_id: SeedPrimitivesSignatureAccountId20,
collection_id: u32
): Vec<u32>nextCollectionId โ
The next available incrementing collection id
Namespace
api.query.nft.nextCollectionIdType
function nextCollectionId(
): u32publicMintInfo โ
Map from collection to its public minting information
Namespace
api.query.nft.publicMintInfoType
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.utilityFlagsType
type CollectionUtilityFlags = {
transferable: bool,
burnable: bool,
mintable: bool,
}
function utilityFlags(u32): CollectionUtilityFlagsadditionalTokenData โ
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.additionalTokenDataType
function additionalTokenData(
(u32, u32)
): BytestokenUtilityFlags โ
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.tokenUtilityFlagsType
type TokenUtilityFlags = {
transferable: bool,
burnAuthority: Option<TokenBurnAuthority>,
}
function tokenUtilityFlags(
(u32, u32)
): TokenUtilityFlagspendingIssuances โ
Map from a collection id to the collection's pending issuances
Namespace
api.query.nft.pendingIssuancesType
type PendingIssuance = {
issuanceId: u32;
quantity: u32;
burnAuthority: TokenBurnAuthority;
}
type CollectionPendingIssuances = {
nextIssuanceId: u32;
pendingIssuances: Vec<(AccountId, PendingIssuance)>;
}
function pendingIssuances(
u32
): CollectionPendingIssuancesCan 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.BaseUriSetType
type BaseUriSet = {
collection_id: u32,
base_uri: Bytes
}BridgedMint โ
Token(s) were bridged
Namespace
api.events.nft.BridgedMintType
type BridgedMint = {
collection_id: u32,
serial_numbers: Vec<u32>,
owner: SeedPrimitivesSignatureAccountId20
}Burn โ
A token was burned
Namespace
api.events.nft.BurnType
type Burn = {
token_owner: SeedPrimitivesSignatureAccountId20,
collection_id: u32,
serial_number: u32
}CollectionClaimed โ
Collection has been claimed
Namespace
api.events.nft.CollectionClaimedType
type CollectionClaimed = {
account: SeedPrimitivesSignatureAccountId20,
collection_id: u32
}CollectionCreate โ
A new collection of tokens was created
Namespace
api.events.nft.CollectionCreateType
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.MaxIssuanceSetType
type MaxIssuanceSet = {
collection_id: u32,
max_issuance: u32
}Mint โ
Token(s) were minted
Namespace
api.events.nft.MintType
type Mint = {
collection_id: u32,
start: u32,
end: u32,
owner: SeedPrimitivesSignatureAccountId20
}MintFeePaid โ
Payment was made to cover a public mint
Namespace
api.events.nft.MintFeePaidType
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.MintPriceSetType
type MintPriceSet = {
collection_id: u32,
payment_asset: Option<u32>,
mint_price: Option<u128>
}NameSet โ
Name was set
Namespace
api.events.nft.NameSetType
type NameSet = {
collection_id: u32,
name: Bytes
}OwnerSet โ
A new owner was set
Namespace
api.events.nft.OwnerSetType
type OwnerSet = {
collection_id: u32,
new_owner: SeedPrimitivesSignatureAccountId20
}PublicMintToggle โ
Public minting was enabled/disabled for a collection
Namespace
api.events.nft.PublicMintToggleType
type PublicMintToggle = {
collection_id: u32,
enabled: bool
}RoyaltiesScheduleSet โ
Royalties schedule was set
Namespace
api.events.nft.RoyaltiesScheduleSetType
type RoyaltiesScheduleSet = {
collection_id: u32,
royalties_schedule: SeedPrimitivesNftRoyaltiesSchedule
}Transfer โ
A token was transferred
Namespace
api.events.nft.TransferType
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.UtilityFlagsSetType
type UtilityFlagsSet = {
collection_id: u32,
utility_flags: CollectionUtilityFlags
}TokenTransferableFlagSet โ
Token transferable flag was set
Namespace
api.events.nft.TokenTransferableFlagSetType
type TokenTransferableFlagSet = {
token_id: (u32, u32),
transferable: bool
}PendingIssuanceCreated โ
A pending issuance for a soulbound token was created
Namespace
api.events.nft.PendingIssuanceCreatedType
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.IssuedType
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.AdditionalDataSetType
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.AttemptedMintOnBridgedTokenBlockedMint โ
Token(s) blocked from minting during the bridging process
Namespace
api.errors.nft.BlockedMintCannotClaimNonClaimableCollections โ
Cannot claim already claimed collections
Namespace
api.errors.nft.CannotClaimNonClaimableCollectionsCannotUpdateMetadata โ
Only Root originated NFTs that are not XLS-20 compatible can have their metadata updated
Namespace
api.errors.nft.CannotUpdateMetadataCollectionIssuanceNotZero โ
Total issuance of collection must be zero to add xls20 compatibility
Namespace
api.errors.nft.CollectionIssuanceNotZeroMintUtilityBlocked โ
Minting has been disabled for tokens within this collection
Namespace
api.errors.nft.MintUtilityBlockedCollectionNameInvalid โ
Given collection name is invalid (invalid utf-8, too long, empty)
Namespace
api.errors.nft.CollectionNameInvalidInitialIssuanceNotZero โ
Initial issuance on XLS-20 compatible collections must be zero
Namespace
api.errors.nft.InitialIssuanceNotZeroInvalidMaxIssuance โ
Max issuance needs to be greater than 0 and initial_issuance Cannot exceed MaxTokensPerCollection
Namespace
api.errors.nft.InvalidMaxIssuanceInvalidMetadataPath โ
The metadata path is invalid (non-utf8 or empty)
Namespace
api.errors.nft.InvalidMetadataPathInvalidNewOwner โ
The caller can not be the new owner
Namespace
api.errors.nft.InvalidNewOwnerInvalidAdditionalData โ
The additional data cannot be an empty vec
Namespace
api.errors.nft.InvalidAdditionalDataMaxIssuanceAlreadySet โ
The max issuance has already been set and can't be changed
Namespace
api.errors.nft.MaxIssuanceAlreadySetMaxIssuanceReached โ
The collection max issuance has been reached and no more tokens can be minted
Namespace
api.errors.nft.MaxIssuanceReachedMintLimitExceeded โ
The quantity exceeds the max tokens per mint limit
Namespace
api.errors.nft.MintLimitExceededNoAvailableIds โ
No more Ids are available, they've been exhausted
Namespace
api.errors.nft.NoAvailableIdsNoCollectionFound โ
The collection does not exist
Namespace
api.errors.nft.NoCollectionFoundNotCollectionOwner โ
Origin is not the collection owner and is not permitted to perform the operation
Namespace
api.errors.nft.NotCollectionOwnerNoToken โ
The token does not exist
Namespace
api.errors.nft.NoTokenNotTokenOwner โ
Origin does not own the NFT
Namespace
api.errors.nft.NotTokenOwnerPublicMintDisabled โ
This collection has not allowed public minting
Namespace
api.errors.nft.PublicMintDisabledRoyaltiesInvalid โ
Total royalties would exceed 100% of sale or an empty vec is supplied
Namespace
api.errors.nft.RoyaltiesInvalidTokenLimitExceeded โ
The number of tokens have exceeded the max tokens allowed
Namespace
api.errors.nft.TokenLimitExceededTokenLocked โ
Cannot operate on a listed NFT
Namespace
api.errors.nft.TokenLockedTransferUtilityBlocked โ
Transfer has been disabled for tokens within this collection
Namespace
api.errors.nft.TransferUtilityBlockedBurnUtilityBlocked โ
Burning has been disabled for tokens within this collection
Namespace
api.errors.nft.BurnUtilityBlockedPendingIssuanceLimitExceeded โ
The number of pending issuances has exceeded the max for a collection
Namespace
api.errors.nft.PendingIssuanceLimitExceededInvalidPendingIssuance โ
Attempted to accept an issuance that does not exist, or is not set for the caller
Namespace
api.errors.nft.InvalidPendingIssuanceCannotUpdateTokenUtility โ
Attempted to update the token utility flags for a soulbound token
Namespace
api.errors.nft.CannotUpdateTokenUtilityInvalidBurnAuthority โ
Attempted to burn a token from an account that does not adhere to the token's burn authority
Namespace
api.errors.nft.InvalidBurnAuthoritySerialNumbersNotUnique โ
The SerialNumbers attempting to be transferred are not unique
Namespace
api.errors.nft.SerialNumbersNotUniqueConstants โ
palletId โ
This pallet's Id, used for deriving a sovereign account ID
Namespace
api.consts.nft.palletIdType
type palletId = FrameSupportPalletIdstringLimit โ
The maximum length of a collection name, stored on-chain
Namespace
api.consts.nft.stringLimitType
type stringLimit = u32JSON-RPC Methods โ
ownedTokens โ
Get all NFTs owned by an account
Interface
api.rpc.nft.ownedTokens(collectionId: CollectionUuid, who: AccountId, cursor: SerialNumber, limit: u16): JsonJSON
{ "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): JsonJSON
{ "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): JsonJSON
{ "id":1, "jsonrpc":"2.0", "method":"nft_collectionDetails", "params":[collectionId: CollectionUuid] }