NFI The NFI (Non-Fungible Intelligence) pallet allows for enabling NFI compatibility on new or existing collections. Once enabled, when an NFI-compatible NFT/SFT is minted, our trusted relayer will automatically generate the NFI data, storing the resulting NFIData on-chain.
Note: There may be an additional charge for NFTs minted with NFI enabled. See the MintFee section below. 0.5% of the mint fee is sent to the Vortex for redistribution to network participants.
Pallet Calls
Enable NFI
Currently disabled on TRN mainnet.
Enables NFI compatibility on a collection. Caller must be the collection owner
Namespace:
Type:
Copy function enableNfi (
collection_id : u32 ,
sub_type : SeedPrimitivesNfiNFISubType
)
Manual Data Request
Users can manually request NFI data if it does not already exist on a token. This can be used to manually request data for pre-existing tokens in a collection that has had NFI enabled Caller must be either the token owner or the collection owner Note. the mint fee will need to be paid for any manual request
Namespace:
Copy api.tx.nfi.manualDataRequest
Type:
Copy function manualDataRequest (
token_id : (u32 , u32) ,
sub_type : SeedPrimitivesNfiNFISubType
)
Submit NFI Data
Submit NFI data to the chain. Caller must be the registered relayer. NFI must be enabled for the collection
Namespace:
Copy api.tx.nfi.submitNfiData
Type:
Copy function submitNfiData (
token_id : (u32 , u32) ,
data_item : SeedPrimitivesNfiNFIDataType
)
Set Fee Details (Sudo Only)
Set the NFI mint fee which is paid per token by the minter. Setting fee_details to None removes the mint fee
Namespace:
Copy api.tx.nfi.setFeeDetails
Type:
Copy function setFeeDetails (
sub_type : SeedPrimitivesNfiNFISubType ,
fee_details : Option < SeedPrimitivesNfiFeeDetails >
)
Set Relayer (Sudo Only)
Set the relayer address. This address is able to submit the NFI data back to the chain. Caller must be sudo
Namespace:
Copy api.tx.nfi.setRelayer
Type:
Copy function setRelayer (
relayer : SeedPrimitivesSignatureAccountId20 ,
)
Set Fee To (Sudo Only)
Set the 'FeeTo' account. Caller must be sudo
Namespace:
Type:
Copy function setFeeTo (
fee_to : Option < SeedPrimitivesSignatureAccountId20 > ,
)
Pallet Storage
Relayer
Stores the permission enabled relayer account
Namespace:
Copy api.query.nfi.relayer
Type:
Copy function relayer () : Option < SeedPrimitivesSignatureAccountId20 >
Mint Fee
Stores the extra mint fee that is charged for NFI enabled tokens
Namespace:
Copy api.query.nfi.mintFee
Type:
Copy function mintFee (
SeedPrimitivesNfiNFISubType
) : SeedPrimitivesNfiFeeDetails
NFI Data
Stores the NFI Data linked to a token
Namespace:
Copy api.query.nfi.nfiData
Type:
Copy function nfiData (
(u32 , u32), // token_id
SeedPrimitivesNfiNFISubType
) : SeedPrimitivesNfiDataType
NFI Enabled
Whether or not NFI is enabled for a collection
Namespace:
Copy api.query.nfi.nfiEnabled
Type:
Copy function nfiEnabled (
u32 , // collection_id
SeedPrimitivesNfiNFISubType
) : boolean
Fee To
The Fee To address that collects network fees
Namespace:
Type:
Copy function feeTo () : Option < SeedPrimitivesSignatureAccountId20 >
Pallet Events
Data Request
Request for new NFI data creation
Namespace:
Copy api.events.nfi.DataRequest
Type:
Copy type DataRequest = {
sub_type : SeedPrimitivesNfiNFISubType ,
caller : SeedPrimitivesSignatureAccountId20 ,
collection_id : u32 ,
serial_numbers : Vec < u32 >
}
Data Set
A new NFI storage item has been set
Namespace:
Copy api.events.nfi.DataSet
Type:
Copy type DataSet = {
sub_type : SeedPrimitivesNfiNFISubType ,
token_id : (u32 , u32) ,
data_item : SeedPrimitivesNfiNFIDataType
}
Data Removed
NFI storage has been removed for a token
Namespace:
Copy api.events.nfi.DataRemoved
Type:
Copy type DataRemoved = {
token_id : (u32 , u32)
}
Fee Details Set
New fee details have been set
Namespace:
Copy api.events.nfi.FeeDetailsSet
Type:
Copy type FeeDetailsSet = {
sub_type : SeedPrimitivesNfiNFISubType ,
fee_details : SeedPrimitivesNfiFeeDetails
}
Fee To Set
The network fee receiver address has been updated
Namespace:
Copy api.events.nfi.FeeToSet
Type:
Copy type FeeToSet = {
account : SeedPrimitivesSignatureAccountId20
}
Mint Fee Paid
Additional mint fee has been paid to the receiver address
Namespace:
Copy api.events.nfi.MintFeePaid
Type:
Copy type MintFeePaid = {
sub_type : SeedPrimitivesNfiNFISubType ,
who : SeedPrimitivesSignatureAccountId20 ,
asset_id : u32 ,
total_fee : u128
}
NFI Enabled
NFI compatibility enabled for a collection
Namespace:
Copy api.events.nfi.NfiEnabled
Type:
Copy type NfiEnabled = {
sub_type : SeedPrimitivesNfiNFISubType ,
collection_id : u32 ,
}
Relayer Set
A new relayer has been set
Namespace:
Copy api.events.nfi.RelayerSet
Type:
Copy type RelayerSet = {
account : SeedPrimitivesSignatureAccountId20
}
Pallet Errors
Invalid Mint Fee
The mint fee must be a valid integer above 0
Namespace:
Copy api.errors.nfi.InvalidMintFee
Not Enabled
NFI storage is not enabled for this collection
Namespace:
Copy api.errors.nfi.NotEnabled
Not Relayer
The caller is not the relayer and does not have permission to perform this action
Namespace:
Copy api.errors.nfi.NotRelayer
Not Collection Owner
The caller is not the collection owner and does not have permission to perform this action
Namespace:
Copy api.errors.nfi.NotCollectionOwner
Not Token Owner
The caller is not the token owner and does not have permission to perform this action
Namespace:
Copy api.errors.nfi.NotTokenOwner
No Token
The token does not exist
Namespace:
Copy api.errors.nfi.NoToken
Pallet Constants
Network Fee Percentage
Percentage of sale price to charge for network fees
Namespace:
Copy api.consts.nfi.NetworkFeePercentage
Type:
Copy type NetworkFeePercentage = Permill
Max Data Length
Maximum length of data stored per token
Namespace:
Copy api.consts.nfi.MaxDataLength
Type:
Copy type MaxDataLength = u32