Calls
burn
Burn a token 🔥
Caller must be the token owner
Namespace
Type
Copy 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
Copy api.tx.nft.claimUnownedCollection
Type
Copy 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
Copy api.tx.nft.createCollection
Type
Copy 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
----------- Weight is O(N) where N is quantity
Namespace
Type
Copy 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
Copy api.tx.nft.setBaseUri
Type
Copy function setBaseUri (
collection_id : u32 ,
base_uri : Bytes
)
setMaxIssuance
Set the max issuance of a collection Caller must be the current collection owner
Namespace
Copy api.tx.nft.setMaxIssuance
Type
Copy function setMaxIssuance (
collection_id : u32 ,
max_issuance : u32
)
setMintFee
Namespace
Copy api.tx.nft.setMintFee
Type
Copy 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
Type
Copy function setName (
collection_id : u32 ,
name : Bytes
)
setOwner
Set the owner of a collection Caller must be the current collection owner
Namespace
Type
Copy function setOwner (
collection_id : u32 ,
new_owner : SeedPrimitivesSignatureAccountId20
)
setRoyaltiesSchedule
Set the royalties schedule of a collection Caller must be the current collection owner
Namespace
Copy api.tx.nft.setRoyaltiesSchedule
Type
Copy function setRoyaltiesSchedule (
collection_id : u32 ,
royalties_schedule : SeedPrimitivesNftRoyaltiesSchedule
)
togglePublicMint
Namespace
Copy api.tx.nft.togglePublicMint
Type
Copy function togglePublicMint (
collection_id : u32 ,
enabled : bool
)
transfer
Transfer ownership of an NFT Caller must be the token owner
Namespace
Type
Copy function transfer (
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
new_owner : SeedPrimitivesSignatureAccountId20
)
Storage
collectionInfo
Map from collection to its information
Namespace
Copy api.query.nft.collectionInfo
Type
Copy function collectionInfo (
u32
) : Option < PalletNftCollectionInformation >
nextCollectionId
The next available incrementing collection id
Namespace
Copy api.query.nft.nextCollectionId
Type
Copy function nextCollectionId (
) : u32
publicMintInfo
Map from collection to its public minting information
Namespace
Copy api.query.nft.publicMintInfo
Type
Copy function publicMintInfo (
u32
) : Option < SeedPalletCommonUtilsPublicMintInformation >
tokenLocks
Map from a token to lock status if any
Namespace
Copy api.query.nft.tokenLocks
Type
Copy function tokenLocks (
(u32 , u32)
) : Option < SeedPrimitivesNftTokenLockReason >
Events
BaseUriSet
Base URI was set
Namespace
Copy api.events.nft.BaseUriSet
Type
Copy type BaseUriSet = {
collection_id : u32 ,
base_uri : Bytes
}
BridgedMint
Token(s) were bridged
Namespace
Copy api.events.nft.BridgedMint
Type
Copy type BridgedMint = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
owner : SeedPrimitivesSignatureAccountId20
}
Burn
A token was burned
Namespace
Type
Copy type Burn = {
collection_id : u32 ,
serial_number : u32
}
CollectionClaimed
Collection has been claimed
Namespace
Copy api.events.nft.CollectionClaimed
Type
Copy type CollectionClaimed = {
account : SeedPrimitivesSignatureAccountId20 ,
collection_id : u32
}
CollectionCreate
A new collection of tokens was created
Namespace
Copy api.events.nft.CollectionCreate
Type
Copy 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
Copy api.events.nft.MaxIssuanceSet
Type
Copy type MaxIssuanceSet = {
collection_id : u32 ,
max_issuance : u32
}
Mint
Token(s) were minted
Namespace
Type
Copy type Mint = {
collection_id : u32 ,
start : u32 ,
end : u32 ,
owner : SeedPrimitivesSignatureAccountId20
}
MintFeePaid
Payment was made to cover a public mint
Namespace
Copy api.events.nft.MintFeePaid
Type
Copy 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
Copy api.events.nft.MintPriceSet
Type
Copy type MintPriceSet = {
collection_id : u32 ,
payment_asset : Option < u32 > ,
mint_price : Option < u128 >
}
NameSet
Name was set
Namespace
Copy api.events.nft.NameSet
Type
Copy type NameSet = {
collection_id : u32 ,
name : Bytes
}
OwnerSet
A new owner was set
Namespace
Copy api.events.nft.OwnerSet
Type
Copy type OwnerSet = {
collection_id : u32 ,
new_owner : SeedPrimitivesSignatureAccountId20
}
PublicMintToggle
Public minting was enabled/disabled for a collection
Namespace
Copy api.events.nft.PublicMintToggle
Type
Copy type PublicMintToggle = {
collection_id : u32 ,
enabled : bool
}
RoyaltiesScheduleSet
Royalties schedule was set
Namespace
Copy api.events.nft.RoyaltiesScheduleSet
Type
Copy type RoyaltiesScheduleSet = {
collection_id : u32 ,
royalties_schedule : SeedPrimitivesNftRoyaltiesSchedule
}
Transfer
A token was transferred
Namespace
Copy api.events.nft.Transfer
Type
Copy type Transfer = {
previous_owner : SeedPrimitivesSignatureAccountId20 ,
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
new_owner : SeedPrimitivesSignatureAccountId20
}
Errors
AttemptedMintOnBridgedToken
Attemped to mint a token that was bridged from a different chain
Namespace
Copy api.errors.nft.AttemptedMintOnBridgedToken
BlockedMint
Token(s) blocked from minting during the bridging process
Namespace
Copy api.errors.nft.BlockedMint
CannotClaimNonClaimableCollections
Cannot claim already claimed collections
Namespace
Copy api.errors.nft.CannotClaimNonClaimableCollections
CollectionIssuanceNotZero
Total issuance of collection must be zero to add xls20 compatibility
Namespace
Copy api.errors.nft.CollectionIssuanceNotZero
CollectionNameInvalid
Given collection name is invalid (invalid utf-8, too long, empty)
Namespace
Copy api.errors.nft.CollectionNameInvalid
InitialIssuanceNotZero
Initial issuance on XLS-20 compatible collections must be zero
Namespace
Copy api.errors.nft.InitialIssuanceNotZero
InvalidMaxIssuance
Max issuance needs to be greater than 0 and initial_issuance Cannot exceed MaxTokensPerCollection
Namespace
Copy api.errors.nft.InvalidMaxIssuance
InvalidMetadataPath
The metadata path is invalid (non-utf8 or empty)
Namespace
Copy api.errors.nft.InvalidMetadataPath
InvalidNewOwner
The caller can not be the new owner
Namespace
Copy api.errors.nft.InvalidNewOwner
MaxIssuanceAlreadySet
The max issuance has already been set and can't be changed
Namespace
Copy api.errors.nft.MaxIssuanceAlreadySet
MaxIssuanceReached
The collection max issuance has been reached and no more tokens can be minted
Namespace
Copy api.errors.nft.MaxIssuanceReached
MintLimitExceeded
The quantity exceeds the max tokens per mint limit
Namespace
Copy api.errors.nft.MintLimitExceeded
NoAvailableIds
No more Ids are available, they've been exhausted
Namespace
Copy api.errors.nft.NoAvailableIds
NoCollectionFound
The collection does not exist
Namespace
Copy api.errors.nft.NoCollectionFound
NotCollectionOwner
Origin is not the collection owner and is not permitted to perform the operation
Namespace
Copy api.errors.nft.NotCollectionOwner
NoToken
The token does not exist
Namespace
Copy api.errors.nft.NoToken
NotTokenOwner
Origin does not own the NFT
Namespace
Copy api.errors.nft.NotTokenOwner
PublicMintDisabled
This collection has not allowed public minting
Namespace
Copy api.errors.nft.PublicMintDisabled
RoyaltiesInvalid
Total royalties would exceed 100% of sale or an empty vec is supplied
Namespace
Copy api.errors.nft.RoyaltiesInvalid
TokenLimitExceeded
The number of tokens have exceeded the max tokens allowed
Namespace
Copy api.errors.nft.TokenLimitExceeded
TokenLocked
Cannot operate on a listed NFT
Namespace
Copy api.errors.nft.TokenLocked
Constants
palletId
This pallet's Id, used for deriving a sovereign account ID
Namespace
Copy api.consts.nft.palletId
Type
Copy type palletId = FrameSupportPalletId
stringLimit
The maximum length of a collection name, stored on-chain
Namespace
Copy api.consts.nft.stringLimit
Type
Copy type stringLimit = u32
JSON-RPC Methods
ownedTokens
Get all NFTs owned by an account
Interface
Copy api.rpc.nft.ownedTokens(collectionId: CollectionUuid, who: AccountId, cursor: SerialNumber, limit: u16): Json
JSON
Copy { "id" : 1 , "jsonrpc" : "2.0" , "method" : "nft_ownedTokens" , "params" : [collectionId: CollectionUuid , who: AccountId , cursor: SerialNumber , limit: u 16 ] }
tokenUri
Get the URI of a token
Interface
Copy api.rpc.nft.tokenUri(tokenId: TokenId): Json
JSON
Copy { "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
Copy api.rpc.nft.collectionDetails(collectionId: CollectionUuid): Json
JSON
Copy { "id" : 1 , "jsonrpc" : "2.0" , "method" : "nft_collectionDetails" , "params" : [collectionId: CollectionUuid] }