Trait FungibleTokenTrait

Source
pub trait FungibleTokenTrait<'a, P: JsonRpcProvider>: TokenTrait<'a, P> {
    const BALANCE_OF: &'static str = "balanceOf";
    const TRANSFER: &'static str = "transfer";

    // Provided methods
    fn get_balance_of<'life0, 'life1, 'async_trait>(
        &'life0 self,
        script_hash: &'life1 ScriptHash,
    ) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_balance_of_hash160<'life0, 'life1, 'async_trait>(
        &'life0 self,
        script_hash: &'life1 H160,
    ) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_total_balance<'life0, 'life1, 'async_trait>(
        &'life0 self,
        wallet: &'life1 Wallet,
    ) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn transfer_from_account<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        from: &'life1 Account,
        to: &'life2 ScriptHash,
        amount: i32,
        data: Option<ContractParameter>,
    ) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn transfer_from_hash160<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        from: &'life1 ScriptHash,
        to: &'life2 ScriptHash,
        amount: i32,
        data: Option<ContractParameter>,
    ) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn build_transfer_script<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        from: &'life1 ScriptHash,
        to: &'life2 ScriptHash,
        amount: i32,
        data: Option<ContractParameter>,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, ContractError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn transfer_from_account_to_nns<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        from: &'life1 Account,
        to: &'life2 NNSName,
        amount: i32,
        data: Option<ContractParameter>,
    ) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn transfer_from_hash160_to_nns<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        from: &'life1 ScriptHash,
        to: &'life2 NNSName,
        amount: i32,
        data: Option<ContractParameter>,
    ) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}

Provided Associated Constants§

Source

const BALANCE_OF: &'static str = "balanceOf"

Source

const TRANSFER: &'static str = "transfer"

Provided Methods§

Source

fn get_balance_of<'life0, 'life1, 'async_trait>( &'life0 self, script_hash: &'life1 ScriptHash, ) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_balance_of_hash160<'life0, 'life1, 'async_trait>( &'life0 self, script_hash: &'life1 H160, ) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_total_balance<'life0, 'life1, 'async_trait>( &'life0 self, wallet: &'life1 Wallet, ) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn transfer_from_account<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, from: &'life1 Account, to: &'life2 ScriptHash, amount: i32, data: Option<ContractParameter>, ) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn transfer_from_hash160<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, from: &'life1 ScriptHash, to: &'life2 ScriptHash, amount: i32, data: Option<ContractParameter>, ) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn build_transfer_script<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, from: &'life1 ScriptHash, to: &'life2 ScriptHash, amount: i32, data: Option<ContractParameter>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, ContractError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn transfer_from_account_to_nns<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, from: &'life1 Account, to: &'life2 NNSName, amount: i32, data: Option<ContractParameter>, ) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn transfer_from_hash160_to_nns<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, from: &'life1 ScriptHash, to: &'life2 NNSName, amount: i32, data: Option<ContractParameter>, ) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

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§