Adds a basic pallet for non-fungible tokens. Users should be able to create collections, issue and redeem NFTs. The settlement and portfolio pallets have also been changed to allow transferring NFTs and moving them between portfolios.
changelog
new features
- Adds the NFT Pallet:
create_nft_collection
extrinsicissue_nft
extrinsicredeem_nft
extirinsic
- Enhances the Settlement pallet to allow NFTs transfer:
add_instruction_with_memo_v2
extrinsicadd_and_affirm_instruction_with_memo_v2
extrinsicaffirm_instruction_v2
extrinsicwithdraw_affirmation_v2
extrinsicreject_instruction_v2
extrinsic
- Enhances the Portfolio pallet to allow moving NFTs between portfolios:
move_portfolio_funds_v2
extrinsic
- Adds
nft_validateNFTTransfer
rpc call
modified API
- The following events have been added to the Settlement pallet:
InstructionV2Created
- The following errors have been added to the Settlement pallet:
DuplicatedNFTId
,InvalidLegAsset
,MaxNumberOfNFTsExceeded
,MaxNumberOfNFTsPerLegExceeded
,NumberOfTransferredNFTsUnderestimated
,DeprecatedCallOnV2Instruction
,ReceiptForNonFungibleAsset
- The following events have been added to the Portfolio pallet:
NFTsMovedBetweenPortfolios
,FungibleTokensMovedBetweenPortfolios
- The following errors have been added to the Portfolio pallet:
NFTNotFoundInPortfolio
,NFTAlreadyLocked
,NFTNotLocked
,InvalidTransferNFTNotOwned
,InvalidTransferNFTIsLocked
- Adds the following error variants to the asset pallet:
UnexpectedNonFungibleToken
,IncompatibleAssetTypeUpdate
;
- Adds
NonFungible(NonFungibleType)
toAssetType
: - Adds
remove_local_metadata_key
to remove (non-locked) local metadata keys - Adds
remove_metadata_value
for managing metadata - Adds the
InvalidNFTTransferCountOverflow
,InvalidNFTTransferInsufficientCount
,MaxNumberOfNFTsPerLegExceeded
,ZeroCount
,DuplicatedNFTId
error variants to the NFT pallet; - Removes the
InvalidNFTTransferBalanceOverflow
,InvalidNFTTransferNoBalance
, error variants from the NFT pallet; - Removes
DuplicatedNFTId
error variant from the setlement pallet - Adds
execute_scheduled_instruction_v2
extrinsic
modified logic
delete_portfolio
will also check for NFTs. If there are NFTs when trying to delete a portfolio, the function will return aPortfolioNotEmpty
error.base_update_asset_type
fails updating a fungible asset to a non-fungible one, and the other way around.unsafe_transfer
,_mint
,base_make_divisible
, andbase_redeem
return an error for non-fungible tokens.- Adds the weight of executing the instruction to
add_and_affirm_instruction_with_memo_v2
andadd_instruction_with_memo_v2
. - Throw error
InvestorUniquenessNotAllowed
ifAsset.create_asset
is called withdisable_iu: false
.