Trait multiversx_sc::api::CallValueApiImpl
source · pub trait CallValueApiImpl: ErrorApiImpl + ManagedTypeApiImpl + Sized {
// Required methods
fn check_not_payable(&self);
fn load_egld_value(&self, dest_handle: Self::BigIntHandle);
fn esdt_num_transfers(&self) -> usize;
fn load_single_esdt_value(&self, dest_handle: Self::BigIntHandle);
fn token(&self) -> Option<Self::ManagedBufferHandle>;
fn esdt_token_nonce(&self) -> u64;
fn esdt_token_type(&self) -> EsdtTokenType;
fn esdt_value_by_index(&self, index: usize) -> Self::BigIntHandle;
fn token_by_index(&self, index: usize) -> Self::ManagedBufferHandle;
fn esdt_token_nonce_by_index(&self, index: usize) -> u64;
fn esdt_token_type_by_index(&self, index: usize) -> EsdtTokenType;
// Provided method
fn load_all_esdt_transfers(&self, dest_handle: Self::ManagedBufferHandle) { ... }
}
Required Methods§
fn check_not_payable(&self)
sourcefn load_egld_value(&self, dest_handle: Self::BigIntHandle)
fn load_egld_value(&self, dest_handle: Self::BigIntHandle)
Retrieves the EGLD call value from the VM. Will return 0 in case of an ESDT transfer (cannot have both EGLD and ESDT transfer simultaneously).
fn esdt_num_transfers(&self) -> usize
sourcefn load_single_esdt_value(&self, dest_handle: Self::BigIntHandle)
fn load_single_esdt_value(&self, dest_handle: Self::BigIntHandle)
Retrieves the ESDT call value from the VM. Will return 0 in case of an EGLD transfer (cannot have both EGLD and ESDT transfer simultaneously).
sourcefn token(&self) -> Option<Self::ManagedBufferHandle>
fn token(&self) -> Option<Self::ManagedBufferHandle>
Returns the call value token identifier of the current call. The identifier is wrapped in a TokenIdentifier object, to hide underlying logic.
sourcefn esdt_token_nonce(&self) -> u64
fn esdt_token_nonce(&self) -> u64
Returns the nonce of the received ESDT token. Will return 0 in case of EGLD or fungible ESDT transfer.
sourcefn esdt_token_type(&self) -> EsdtTokenType
fn esdt_token_type(&self) -> EsdtTokenType
Returns the ESDT token type. Will return “Fungible” for EGLD.
fn esdt_value_by_index(&self, index: usize) -> Self::BigIntHandle
fn token_by_index(&self, index: usize) -> Self::ManagedBufferHandle
fn esdt_token_nonce_by_index(&self, index: usize) -> u64
fn esdt_token_type_by_index(&self, index: usize) -> EsdtTokenType
Provided Methods§
sourcefn load_all_esdt_transfers(&self, dest_handle: Self::ManagedBufferHandle)
fn load_all_esdt_transfers(&self, dest_handle: Self::ManagedBufferHandle)
Loads all ESDT call values into a managed vec. Overwrites destination.