1use codec::{Decode, Encode, MaxEncodedLen};2use scale_info::TypeInfo;34#[cfg(feature = "std")]5use serde::Serialize;67#[cfg(feature = "std")]8use crate::serialize;910use crate::primitives::*;1112#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, Debug, TypeInfo, MaxEncodedLen)]13#[cfg_attr(feature = "std", derive(Serialize))]14pub enum AccountIdOrCollectionNftTuple<AccountId> {15 AccountId(AccountId),16 CollectionAndNftTuple(CollectionId, NftId),17}181920#[cfg_attr(feature = "std", derive(PartialEq, Eq, Serialize))]21#[derive(Encode, Decode, Debug, TypeInfo, MaxEncodedLen)]22pub struct RoyaltyInfo<AccountId, RoyaltyAmount> {23 24 pub recipient: AccountId,25 26 pub amount: RoyaltyAmount,27}282930#[cfg_attr(feature = "std", derive(PartialEq, Eq, Serialize))]31#[derive(Encode, Decode, Debug, TypeInfo, MaxEncodedLen)]32#[cfg_attr(33 feature = "std",34 serde(bound = r#"35 AccountId: Serialize,36 RoyaltyAmount: Serialize,37 BoundedString: AsRef<[u8]>38 "#)39)]40pub struct NftInfo<AccountId, RoyaltyAmount, BoundedString> {41 42 pub owner: AccountIdOrCollectionNftTuple<AccountId>,43 44 pub royalty: Option<RoyaltyInfo<AccountId, RoyaltyAmount>>,4546 47 #[cfg_attr(feature = "std", serde(with = "serialize::vec"))]48 pub metadata: BoundedString,4950 51 pub equipped: bool,52 53 pub pending: bool,54}5556#[cfg_attr(feature = "std", derive(PartialEq, Eq, Serialize))]57#[derive(Encode, Decode, TypeInfo, MaxEncodedLen)]58pub struct NftChild {59 pub collection_id: CollectionId,60 pub nft_id: NftId,61}