@@ -19,16 +19,24 @@ pub enum AccountIdOrCollectionNftTuple<AccountId> {
1919 CollectionAndNftTuple ( CollectionId , NftId ) ,
2020}
2121
22+ /// Royalty information (recipient and amount)
23+ #[ cfg_attr( feature = "std" , derive( PartialEq , Eq ) ) ]
24+ #[ derive( Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ) ]
25+ pub struct RoyaltyInfo < AccountId > {
26+ /// Recipient (AccountId) of the royalty
27+ pub recipient : AccountId ,
28+ /// Amount (Permill) of the royalty
29+ pub amount : Permill ,
30+ }
31+
2232/// Nft info.
2333#[ cfg_attr( feature = "std" , derive( PartialEq , Eq ) ) ]
2434#[ derive( Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ) ]
2535pub struct NftInfo < AccountId , BoundedString > {
2636 /// The owner of the NFT, can be either an Account or a tuple (CollectionId, NftId)
2737 pub owner : AccountIdOrCollectionNftTuple < AccountId > ,
28- /// The user account which receives the royalty
29- pub recipient : AccountId ,
30- /// Royalty in per mille (1/1000)
31- pub royalty : Permill ,
38+ /// Royalty (optional)
39+ pub royalty : Option < RoyaltyInfo < AccountId > > ,
3240 /// Arbitrary data about an instance, e.g. IPFS hash
3341 pub metadata : BoundedString ,
3442 /// Equipped state
@@ -46,8 +54,8 @@ pub trait Nft<AccountId, BoundedString> {
4654 sender : AccountId ,
4755 owner : AccountId ,
4856 collection_id : CollectionId ,
49- recipient : Option < AccountId > ,
50- royalty : Option < Permill > ,
57+ royalty_recipient : Option < AccountId > ,
58+ royalty_amount : Option < Permill > ,
5159 metadata : BoundedString ,
5260 ) -> Result < ( CollectionId , NftId ) , DispatchError > ;
5361 fn nft_burn (
0 commit comments