Trait orml_traits::nft::NFT[][src]

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; }

Abstraction over a non-fungible token system.

Associated Types

type ClassId: Default + Copy[src]

The NFT class identifier.

type TokenId: Default + Copy[src]

The NFT token identifier.

type Balance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default[src]

The balance of account.

Loading content...

Required methods

fn balance(who: &AccountId) -> Self::Balance[src]

The number of NFTs assigned to who.

fn owner(token: (Self::ClassId, Self::TokenId)) -> Option<AccountId>[src]

The owner of the given token ID. Returns None if the token does not exist.

fn transfer(
    from: &AccountId,
    to: &AccountId,
    token: (Self::ClassId, Self::TokenId)
) -> DispatchResult
[src]

Transfer the given token ID from one account to another.

Loading content...

Implementors

Loading content...