Skip to main content

Nep11Token

Trait Nep11Token 

Source
pub trait Nep11Token {
    // Required methods
    fn symbol(&self) -> NeoResult<NeoString>;
    fn decimals(&self) -> NeoResult<u8>;
    fn total_supply(&self) -> NeoResult<NeoInteger>;
    fn balance_of(&self, account: &NeoByteString) -> NeoResult<NeoInteger>;
    fn tokens_of(
        &self,
        account: &NeoByteString,
    ) -> NeoResult<NeoArray<NeoValue>>;
    fn transfer(
        &self,
        to: &NeoByteString,
        token_id: &NeoByteString,
        data: &NeoValue,
    ) -> NeoResult<bool>;
    fn owner_of(&self, token_id: &NeoByteString) -> NeoResult<NeoByteString>;
    fn properties(
        &self,
        token_id: &NeoByteString,
    ) -> NeoResult<NeoArray<NeoValue>>;
}
Expand description

NEP-11 non-fungible token standard trait.

Contracts implementing this trait are compliant with the NEP-11 NFT standard on Neo N3.

Required Methods§

Source

fn symbol(&self) -> NeoResult<NeoString>

Returns the token symbol.

Source

fn decimals(&self) -> NeoResult<u8>

Returns the number of decimals (0 for indivisible NFTs).

Source

fn total_supply(&self) -> NeoResult<NeoInteger>

Returns the total supply of issued tokens.

Source

fn balance_of(&self, account: &NeoByteString) -> NeoResult<NeoInteger>

Returns the token balance of the given account.

Source

fn tokens_of(&self, account: &NeoByteString) -> NeoResult<NeoArray<NeoValue>>

Returns an iterator of token IDs owned by the account.

Source

fn transfer( &self, to: &NeoByteString, token_id: &NeoByteString, data: &NeoValue, ) -> NeoResult<bool>

Transfers the NFT identified by token_id to to.

Source

fn owner_of(&self, token_id: &NeoByteString) -> NeoResult<NeoByteString>

Returns the owner of the given token.

Source

fn properties(&self, token_id: &NeoByteString) -> NeoResult<NeoArray<NeoValue>>

Returns properties/metadata for the given token.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§