Calls
burn
Burn a token 🔥
Caller must be the token owner
Namespace
Type
Copy function burn (
collection_id : u32 ,
serial_numbers : Vec <(u32 , u128)>
)
createCollection
Create a new collection to group multiple semi-fungible tokens Tokens can be created within the collection by calling create_token
collection_name
- the name of the collection collection_owner
- the collection 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.
The collectionUuid used to store the SFT CollectionInfo is retrieved from the NFT pallet. This is so that CollectionUuids are unique across all collections, regardless of if they are SFT or NFT collections.
Namespace
Copy api.tx.sft.createCollection
Type
Copy function createCollection (
collection_name : Bytes ,
collection_owner : Option < SeedPrimitivesSignatureAccountId20 > ,
metadata_scheme : Bytes ,
royalties_schedule : Option < SeedPrimitivesNftRoyaltiesSchedule >
)
createToken
Create additional tokens for an existing collection These tokens act similar to tokens within an ERC1155 contract Each token has individual issuance, max_issuance,
Namespace
Copy api.tx.sft.createToken
Type
Copy function createToken (
collection_id : u32 ,
token_name : Bytes ,
initial_issuance : u128 ,
max_issuance : Option < u128 > ,
token_owner : Option < SeedPrimitivesSignatureAccountId20 >
)
mint
Mints some balances into some serial numbers for an account This acts as a batch mint function and allows for multiple serial numbers and quantities to be passed in simultaneously. Must be called by the collection owner
collection_id
- the SFT collection to mint into serial_numbers
- A list of serial numbers to mint into quantities
- A list of quantities to mint into each serial number token_owner
- The owner of the tokens, defaults to the caller
Namespace
Type
Copy function mint (
collection_id : u32 ,
serial_numbers : Vec <(u32 , u128)> ,
token_owner : Option < SeedPrimitivesSignatureAccountId20 >
)
setBaseUri
Set the base URI of a collection (MetadataScheme) Caller must be the current collection owner
Namespace
Copy api.tx.sft.setBaseUri
Type
Copy function setBaseUri (
collection_id : u32 ,
metadata_scheme : Bytes
)
setMaxIssuance
Set the max issuance of a collection Caller must be the current collection owner
Namespace
Copy api.tx.sft.setMaxIssuance
Type
Copy function setMaxIssuance (
token_id : (u32 , u32) ,
max_issuance : u128
)
setMintFee
Namespace
Copy api.tx.sft.setMintFee
Type
Copy function setMintFee (
token_id : (u32 , 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 ,
collection_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.sft.setRoyaltiesSchedule
Type
Copy function setRoyaltiesSchedule (
collection_id : u32 ,
royalties_schedule : SeedPrimitivesNftRoyaltiesSchedule
)
togglePublicMint
Namespace
Copy api.tx.sft.togglePublicMint
Type
Copy function togglePublicMint (
token_id : (u32 , u32) ,
enabled : bool
)
transfer
Transfer ownership of an SFT Caller must be the token owner
Namespace
Type
Copy function transfer (
collection_id : u32 ,
serial_numbers : Vec <(u32 , u128)> ,
new_owner : SeedPrimitivesSignatureAccountId20
)
Storage
publicMintInfo
Map from collection to its public minting information
Namespace
Copy api.query.sft.publicMintInfo
Type
Copy function publicMintInfo (
(u32 , u32)
) : Option < SeedPalletCommonUtilsPublicMintInformation >
sftCollectionInfo
Map from collection to its information
Namespace
Copy api.query.sft.sftCollectionInfo
Type
Copy function sftCollectionInfo (
u32
) : Option < PalletSftSftCollectionInformation >
tokenInfo
Map from token to its token information, including ownership information
Namespace
Copy api.query.sft.tokenInfo
Type
Copy function tokenInfo (
(u32 , u32)
) : Option < PalletSftSftTokenInformation >
Events
BaseUriSet
Base URI was set
Namespace
Copy api.events.sft.BaseUriSet
Type
Copy type BaseUriSet = {
collection_id : u32 ,
metadata_scheme : Bytes
}
Burn
A token was burned
Namespace
Type
Copy type Burn = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
balances : Vec < u128 > ,
owner : SeedPrimitivesSignatureAccountId20
}
CollectionCreate
A new collection of tokens was created
Namespace
Copy api.events.sft.CollectionCreate
Type
Copy type CollectionCreate = {
collection_id : u32 ,
collection_owner : SeedPrimitivesSignatureAccountId20 ,
metadata_scheme : Bytes ,
name : Bytes ,
royalties_schedule : Option < SeedPrimitivesNftRoyaltiesSchedule > ,
origin_chain : SeedPrimitivesNftOriginChain
}
MaxIssuanceSet
Max issuance was set
Namespace
Copy api.events.sft.MaxIssuanceSet
Type
Copy type MaxIssuanceSet = {
token_id : (u32 , u32) ,
max_issuance : u128
}
Mint
Token(s) were minted
Namespace
Type
Copy type Mint = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
balances : Vec < u128 > ,
owner : SeedPrimitivesSignatureAccountId20
}
MintFeePaid
Payment was made to cover a public mint
Namespace
Copy api.events.sft.MintFeePaid
Type
Copy type MintFeePaid = {
who : SeedPrimitivesSignatureAccountId20 ,
token_id : (u32 , u32) ,
payment_asset : u32 ,
payment_amount : u128 ,
token_count : u128
}
MintPriceSet
A mint price was set for a collection
Namespace
Copy api.events.sft.MintPriceSet
Type
Copy type MintPriceSet = {
token_id : (u32 , u32) ,
payment_asset : Option < u32 > ,
mint_price : Option < u128 >
}
NameSet
Name was set
Namespace
Copy api.events.sft.NameSet
Type
Copy type NameSet = {
collection_id : u32 ,
collection_name : Bytes
}
OwnerSet
A new owner was set
Namespace
Copy api.events.sft.OwnerSet
Type
Copy type OwnerSet = {
collection_id : u32 ,
new_owner : SeedPrimitivesSignatureAccountId20
}
PublicMintToggle
Public minting was enabled/disabled for a collection
Namespace
Copy api.events.sft.PublicMintToggle
Type
Copy type PublicMintToggle = {
token_id: (u32,u32),
enabled: bool
}
RoyaltiesScheduleSet
Royalties schedule was set
Namespace
Copy api.events.sft.RoyaltiesScheduleSet
Type
Copy type RoyaltiesScheduleSet = {
collection_id: u32,
royalties_schedule: SeedPrimitivesNftRoyaltiesSchedule
}
TokenCreate
A new token was created within a collection
Namespace
Copy api.events.sft.TokenCreate
Type
Copy type TokenCreate = {
token_id: (u32,u32),
initial_issuance: u128,
max_issuance: Option<u128>,
token_name: Bytes,
token_owner: SeedPrimitivesSignatureAccountId20
}
Transfer
A token was transferred
Namespace
Copy api.events.sft.Transfer
Type
Copy type Transfer = {
previous_owner: SeedPrimitivesSignatureAccountId20,
collection_id: u32,
serial_numbers: Vec<u32>,
balances: Vec<u128>,
new_owner: SeedPrimitivesSignatureAccountId20
}
Errors
InsufficientBalance
The user does not own enough of this token to perform the operation
Namespace
Copy api.errors.sft.InsufficientBalance
InvalidMaxIssuance
Max issuance needs to be greater than 0 and initial_issuance Cannot exceed MaxTokensPerCollection
Namespace
Copy api.errors.sft.InvalidMaxIssuance
InvalidNewOwner
Caller can not be the new owner
Namespace
Copy api.errors.sft.InvalidNewOwner
InvalidQuantity
The specified quantity must be greater than 0
Namespace
Copy api.errors.sft.InvalidQuantity
MaxIssuanceAlreadySet
The max issuance has already been set and can't be changed
Namespace
Copy api.errors.sft.MaxIssuanceAlreadySet
MaxIssuanceReached
The collection max issuance has been reached and no more tokens can be minted
Namespace
Copy api.errors.sft.MaxIssuanceReached
MaxOwnersReached
The max amount of owners per token has been reached
Namespace
Copy api.errors.sft.MaxOwnersReached
NameInvalid
Given collection or token name is invalid (invalid utf-8, empty)
Namespace
Copy api.errors.sft.NameInvalid
NoCollectionFound
The collection does not exist
Namespace
Copy api.errors.sft.NoCollectionFound
NotCollectionOwner
Origin is not the collection owner and is not permitted to perform the operation
Namespace
Copy api.errors.sft.NotCollectionOwner
NoToken
The token does not exist
Namespace
Copy api.errors.sft.NoToken
Overflow
The operation would cause a numeric overflow
Namespace
Copy api.errors.sft.Overflow
PublicMintDisabled
This collection has not allowed public minting
Namespace
Copy api.errors.sft.PublicMintDisabled
RoyaltiesInvalid
Total royalties would exceed 100% of sale or an empty vec is supplied
Namespace
Copy api.errors.sft.RoyaltiesInvalid
Constants
maxOwnersPerSftToken
Max unique owners that can own an SFT token
Namespace
Copy api.consts.sft.maxOwnersPerSftToken
Type
Copy type maxOwnersPerSftToken = u32
maxSerialsPerMint
Max tokens that can be minted in one transaction
Namespace
Copy api.consts.sft.maxSerialsPerMint
Type
Copy type maxSerialsPerMint = u32
maxTokensPerSftCollection
Max tokens that a collection can contain
Namespace
Copy api.consts.sft.maxTokensPerSftCollection
Type
Copy type maxTokensPerSftCollection = u32
palletId
This pallet's Id, used for deriving a sovereign account ID
Namespace
Copy api.consts.sft.palletId
Type
Copy type palletId = FrameSupportPalletId
stringLimit
The maximum length of a collection or token name, stored on-chain
Namespace
Copy api.consts.sft.stringLimit
Type
Copy type stringLimit = u32