Trait elrond_wasm::api::BlockchainApi[][src]

pub trait BlockchainApi: ErrorApi + ManagedTypeApi + Clone + Sized + StorageReadApi + 'static {
Show 33 methods fn get_caller_legacy(&self) -> Address;
fn get_sc_address_legacy(&self) -> Address;
fn get_owner_address_legacy(&self) -> Address;
fn get_shard_of_address_legacy(&self, address: &Address) -> u32;
fn is_smart_contract_legacy(&self, address: &Address) -> bool;
fn get_balance_legacy(&self, address: &Address) -> BigUint<Self>;
fn get_state_root_hash_legacy(&self) -> H256;
fn get_tx_hash_legacy(&self) -> H256;
fn get_gas_left(&self) -> u64;
fn get_block_timestamp(&self) -> u64;
fn get_block_nonce(&self) -> u64;
fn get_block_round(&self) -> u64;
fn get_block_epoch(&self) -> u64;
fn get_block_random_seed_legacy(&self) -> Box<[u8; 48]>
Notable traits for Box<I, A>
impl<I, A> Iterator for Box<I, A> where
    I: Iterator + ?Sized,
    A: Allocator
type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
    F: Future + Unpin + ?Sized,
    A: Allocator + 'static, 
type Output = <F as Future>::Output;
;
fn get_prev_block_timestamp(&self) -> u64;
fn get_prev_block_nonce(&self) -> u64;
fn get_prev_block_round(&self) -> u64;
fn get_prev_block_epoch(&self) -> u64;
fn get_prev_block_random_seed_legacy(&self) -> Box<[u8; 48]>
Notable traits for Box<I, A>
impl<I, A> Iterator for Box<I, A> where
    I: Iterator + ?Sized,
    A: Allocator
type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
    F: Future + Unpin + ?Sized,
    A: Allocator + 'static, 
type Output = <F as Future>::Output;
;
fn get_current_esdt_nft_nonce(
        &self,
        address: &ManagedAddress<Self>,
        token_id: &TokenIdentifier<Self>
    ) -> u64;
fn get_esdt_balance(
        &self,
        address: &ManagedAddress<Self>,
        token_id: &TokenIdentifier<Self>,
        nonce: u64
    ) -> BigUint<Self>;
fn get_esdt_token_data(
        &self,
        address: &ManagedAddress<Self>,
        token_id: &TokenIdentifier<Self>,
        nonce: u64
    ) -> EsdtTokenData<Self>; fn get_caller(&self) -> ManagedAddress<Self> { ... }
fn get_sc_address(&self) -> ManagedAddress<Self> { ... }
fn get_owner_address(&self) -> ManagedAddress<Self> { ... }
fn get_shard_of_address(&self, address: &ManagedAddress<Self>) -> u32 { ... }
fn is_smart_contract(&self, address: &ManagedAddress<Self>) -> bool { ... }
fn get_balance(&self, address: &ManagedAddress<Self>) -> BigUint<Self> { ... }
fn get_state_root_hash(&self) -> ManagedByteArray<Self, 32> { ... }
fn get_tx_hash(&self) -> ManagedByteArray<Self, 32> { ... }
fn get_block_random_seed(&self) -> ManagedByteArray<Self, 48> { ... }
fn get_prev_block_random_seed(&self) -> ManagedByteArray<Self, 48> { ... }
fn get_esdt_local_roles(
        &self,
        token_id: &TokenIdentifier<Self>
    ) -> EsdtLocalRoleFlags { ... }
}
Expand description

Interface to be used by the actual smart contract code.

Note: contracts and the api are not mutable. They simply pass on/retrieve data to/from the protocol. When mocking the blockchain state, we use the Rc/RefCell pattern to isolate mock state mutability from the contract interface.

Required methods

Provided methods

Retrieves local roles for the token, by reading protected storage. TODO: rewrite using managed types

Implementors