1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use codec::FullCodec;
use sp_runtime::{
traits::{AtLeast32BitUnsigned, MaybeSerializeDeserialize},
DispatchResult,
};
use sp_std::fmt::Debug;
#[allow(clippy::upper_case_acronyms)]
pub trait NFT<AccountId> {
type ClassId: Default + Copy;
type TokenId: Default + Copy;
type Balance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default;
fn balance(who: &AccountId) -> Self::Balance;
fn owner(token: (Self::ClassId, Self::TokenId)) -> Option<AccountId>;
fn transfer(from: &AccountId, to: &AccountId, token: (Self::ClassId, Self::TokenId)) -> DispatchResult;
}