Struct dharitri_wasm::contract_base::CallValueWrapper
source · pub struct CallValueWrapper<A>{ /* private fields */ }Implementations§
source§impl<A> CallValueWrapper<A>
impl<A> CallValueWrapper<A>
sourcepub fn moax_value(&self) -> BigUint<A>
pub fn moax_value(&self) -> BigUint<A>
Retrieves the MOAX call value from the VM. Will return 0 in case of an DCT transfer (cannot have both MOAX and DCT transfer simultaneously).
sourcepub fn all_dct_transfers(&self) -> ManagedVec<A, DctTokenPayment<A>>
pub fn all_dct_transfers(&self) -> ManagedVec<A, DctTokenPayment<A>>
Returns all DCT transfers that accompany this SC call. Will return 0 results if nothing was transfered, or just MOAX. Fully managed underlying types, very efficient.
sourcepub fn dct_value(&self) -> BigUint<A>
pub fn dct_value(&self) -> BigUint<A>
Retrieves the DCT call value from the VM.
Will return 0 in case of an MOAX transfer (cannot have both MOAX and DCT transfer simultaneously).
Warning, not tested with multi transfer, use all_dct_transfers instead!
sourcepub fn token(&self) -> TokenIdentifier<A>
pub fn token(&self) -> TokenIdentifier<A>
Returns the call value token identifier of the current call. The identifier is wrapped in a TokenIdentifier object, to hide underlying logic.
A note on implementation: even though the underlying api returns an empty name for MOAX,
but the MOAX TokenIdentifier is serialized as MOAX.
Warning, not tested with multi transfer, use all_dct_transfers instead!
sourcepub fn dct_token_nonce(&self) -> u64
pub fn dct_token_nonce(&self) -> u64
Returns the nonce of the received DCT token.
Will return 0 in case of MOAX or fungible DCT transfer.
Warning, not tested with multi transfer, use all_dct_transfers instead!
sourcepub fn dct_token_type(&self) -> DctTokenType
pub fn dct_token_type(&self) -> DctTokenType
Returns the DCT token type.
Will return “Fungible” for MOAX.
Warning, not tested with multi transfer, use all_dct_transfers instead!
sourcepub fn payment_token_pair(&self) -> (BigUint<A>, TokenIdentifier<A>)
pub fn payment_token_pair(&self) -> (BigUint<A>, TokenIdentifier<A>)
Returns both the call value (either MOAX or DCT) and the token identifier. Especially used in the `#[payable(“*”)] auto-generated snippets. The method might seem redundant, but there is such a hook in Arwen that might be used in this scenario in the future. TODO: replace with multi transfer handling everywhere