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§
Sourcefn total_supply(&self) -> NeoResult<NeoInteger>
fn total_supply(&self) -> NeoResult<NeoInteger>
Returns the total supply of issued tokens.
Sourcefn balance_of(&self, account: &NeoByteString) -> NeoResult<NeoInteger>
fn balance_of(&self, account: &NeoByteString) -> NeoResult<NeoInteger>
Returns the token balance of the given account.
Sourcefn tokens_of(&self, account: &NeoByteString) -> NeoResult<NeoArray<NeoValue>>
fn tokens_of(&self, account: &NeoByteString) -> NeoResult<NeoArray<NeoValue>>
Returns an iterator of token IDs owned by the account.
Sourcefn transfer(
&self,
to: &NeoByteString,
token_id: &NeoByteString,
data: &NeoValue,
) -> NeoResult<bool>
fn transfer( &self, to: &NeoByteString, token_id: &NeoByteString, data: &NeoValue, ) -> NeoResult<bool>
Transfers the NFT identified by token_id to to.
Sourcefn owner_of(&self, token_id: &NeoByteString) -> NeoResult<NeoByteString>
fn owner_of(&self, token_id: &NeoByteString) -> NeoResult<NeoByteString>
Returns the owner of the given token.
Sourcefn properties(&self, token_id: &NeoByteString) -> NeoResult<NeoArray<NeoValue>>
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".