12345use codec::{Decode, Encode, MaxEncodedLen};6use scale_info::TypeInfo;78#[cfg(feature = "std")]9use serde::Serialize;1011#[cfg(feature = "std")]12use crate::serialize;1314use crate::primitives::*;1516#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, Debug, TypeInfo, MaxEncodedLen)]17#[cfg_attr(feature = "std", derive(Serialize))]18pub enum AccountIdOrCollectionNftTuple<AccountId> {19 AccountId(AccountId),20 CollectionAndNftTuple(CollectionId, NftId),21}222324#[cfg_attr(feature = "std", derive(PartialEq, Eq, Serialize))]25#[derive(Encode, Decode, Debug, TypeInfo, MaxEncodedLen)]26pub struct RoyaltyInfo<AccountId, RoyaltyAmount> {27 28 pub recipient: AccountId,29 30 pub amount: RoyaltyAmount,31}323334#[cfg_attr(feature = "std", derive(PartialEq, Eq, Serialize))]35#[derive(Encode, Decode, Debug, TypeInfo, MaxEncodedLen)]36#[cfg_attr(37 feature = "std",38 serde(bound = r#"39 AccountId: Serialize,40 RoyaltyAmount: Serialize,41 BoundedString: AsRef<[u8]>42 "#)43)]44pub struct NftInfo<AccountId, RoyaltyAmount, BoundedString> {45 46 pub owner: AccountIdOrCollectionNftTuple<AccountId>,47 48 pub royalty: Option<RoyaltyInfo<AccountId, RoyaltyAmount>>,4950 51 #[cfg_attr(feature = "std", serde(with = "serialize::vec"))]52 pub metadata: BoundedString,5354 55 pub equipped: bool,56 57 pub pending: bool,58}5960#[cfg_attr(feature = "std", derive(PartialEq, Eq, Serialize))]61#[derive(Encode, Decode, TypeInfo, MaxEncodedLen)]62pub struct NftChild {63 pub collection_id: CollectionId,64 pub nft_id: NftId,65}