Trait TokenTrait

Source
pub trait TokenTrait<'a, P: JsonRpcProvider>: SmartContractTrait<'a, P = P> {
    const TOTAL_SUPPLY: &'static str = "totalSupply";
    const SYMBOL: &'static str = "symbol";
    const DECIMALS: &'static str = "decimals";
Show 14 methods // Required methods fn total_supply(&self) -> Option<u64>; fn set_total_supply(&mut self, total_supply: u64); fn decimals(&self) -> Option<u8>; fn set_decimals(&mut self, decimals: u8); fn symbol(&self) -> Option<String>; fn set_symbol(&mut self, symbol: String); fn resolve_nns_text_record<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 NNSName, ) -> Pin<Box<dyn Future<Output = Result<H160, ContractError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn get_total_supply<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, ContractError>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn get_decimals<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u8, ContractError>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn get_symbol<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<String, ContractError>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn to_fractions( &self, amount: u64, decimals: u32, ) -> Result<i32, ContractError> { ... } fn to_fractions_decimal( &self, amount: Decimal, decimals: u32, ) -> Result<u64, ContractError> { ... } fn to_decimals_u64(&self, fractions: u64, decimals: u32) -> Decimal { ... } fn to_decimals(&self, amount: i64, decimals: u32) -> Decimal { ... }
}

Provided Associated Constants§

Source

const TOTAL_SUPPLY: &'static str = "totalSupply"

Source

const SYMBOL: &'static str = "symbol"

Source

const DECIMALS: &'static str = "decimals"

Required Methods§

Source

fn total_supply(&self) -> Option<u64>

Source

fn set_total_supply(&mut self, total_supply: u64)

Source

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

Source

fn set_decimals(&mut self, decimals: u8)

Source

fn symbol(&self) -> Option<String>

Source

fn set_symbol(&mut self, symbol: String)

Source

fn resolve_nns_text_record<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 NNSName, ) -> Pin<Box<dyn Future<Output = Result<H160, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn get_total_supply<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, ContractError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn get_decimals<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u8, ContractError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn get_symbol<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<String, ContractError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn to_fractions(&self, amount: u64, decimals: u32) -> Result<i32, ContractError>

Source

fn to_fractions_decimal( &self, amount: Decimal, decimals: u32, ) -> Result<u64, ContractError>

Source

fn to_decimals_u64(&self, fractions: u64, decimals: u32) -> Decimal

Source

fn to_decimals(&self, amount: i64, decimals: u32) -> Decimal

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, P: JsonRpcProvider> TokenTrait<'a, P> for FungibleTokenContract<'a, P>

Source§

impl<'a, P: JsonRpcProvider> TokenTrait<'a, P> for GasToken<'a, P>

Source§

impl<'a, P: JsonRpcProvider> TokenTrait<'a, P> for NeoNameService<'a, P>

Source§

impl<'a, P: JsonRpcProvider> TokenTrait<'a, P> for NeoToken<'a, P>

Source§

impl<'a, P: JsonRpcProvider> TokenTrait<'a, P> for NeoburgerContract<'a, P>

Source§

impl<'a, P: JsonRpcProvider> TokenTrait<'a, P> for NftContract<'a, P>