Trait pallet_nft::NFTInterface[][src]

pub trait NFTInterface<Hash, AccountId> {
    fn token_exist(collection_id: Hash, token_id: u128) -> bool;
fn get_nft_token(
        collection_id: Hash,
        token_id: u128
    ) -> TokenInfo<AccountId>;
fn get_balance(collection_id: &Hash, who: &AccountId) -> u128;
fn get_burned_amount(collection_id: &Hash) -> u128;
fn destory_collection(collection_id: &Hash);
fn _mint_non_fungible(
        receiver: AccountId,
        collection_id: Hash,
        amount: u128,
        uri: Vec<u8>,
        collection: &CollectionInfo<AccountId>
    ) -> Result<(u128, u128), DispatchError>;
fn _mint_fungible(
        receiver: AccountId,
        collection_id: Hash,
        amount: u128,
        collection: &CollectionInfo<AccountId>
    ) -> DispatchResult;
fn _transfer_non_fungible(
        who: AccountId,
        receiver: AccountId,
        collection_id: Hash,
        start_idx: u128,
        amount: u128
    ) -> DispatchResult;
fn _transfer_fungible(
        who: AccountId,
        receiver: AccountId,
        collection_id: Hash,
        amount: u128
    ) -> DispatchResult;
fn _burn_non_fungible(
        who: AccountId,
        collection_id: Hash,
        start_idx: u128,
        amount: u128
    ) -> DispatchResult;
fn _burn_fungible(
        who: AccountId,
        collection_id: Hash,
        amount: u128
    ) -> DispatchResult; }

Required methods

fn token_exist(collection_id: Hash, token_id: u128) -> bool[src]

Check whether the token exists by collection_id and token_id.

fn get_nft_token(collection_id: Hash, token_id: u128) -> TokenInfo<AccountId>[src]

Get token by collection_id and token_id.

fn get_balance(collection_id: &Hash, who: &AccountId) -> u128[src]

Get the balance of an account in a collection.

fn get_burned_amount(collection_id: &Hash) -> u128[src]

Get the count of tokens burned in a collection.

fn destory_collection(collection_id: &Hash)[src]

Destory a collection by collection_id.

fn _mint_non_fungible(
    receiver: AccountId,
    collection_id: Hash,
    amount: u128,
    uri: Vec<u8>,
    collection: &CollectionInfo<AccountId>
) -> Result<(u128, u128), DispatchError>
[src]

Mint NFTs

fn _mint_fungible(
    receiver: AccountId,
    collection_id: Hash,
    amount: u128,
    collection: &CollectionInfo<AccountId>
) -> DispatchResult
[src]

Mint FTs

fn _transfer_non_fungible(
    who: AccountId,
    receiver: AccountId,
    collection_id: Hash,
    start_idx: u128,
    amount: u128
) -> DispatchResult
[src]

Transfer NFTs to another account.

fn _transfer_fungible(
    who: AccountId,
    receiver: AccountId,
    collection_id: Hash,
    amount: u128
) -> DispatchResult
[src]

Transfer FTs to another account.

fn _burn_non_fungible(
    who: AccountId,
    collection_id: Hash,
    start_idx: u128,
    amount: u128
) -> DispatchResult
[src]

burn NFTs.

fn _burn_fungible(
    who: AccountId,
    collection_id: Hash,
    amount: u128
) -> DispatchResult
[src]

burn FTs.

Loading content...

Implementors

impl<T: Config> NFTInterface<<T as Config>::Hash, <T as Config>::AccountId> for Module<T>[src]

Loading content...