pub trait CallValueApiImpl: ErrorApiImpl + ManagedTypeApiImpl {
Show 15 methods // Required methods fn check_not_payable(&self); fn moax_value(&self) -> Handle; fn dct_value(&self) -> Handle; fn token(&self) -> Handle; fn dct_token_nonce(&self) -> u64; fn dct_token_type(&self) -> DctTokenType; fn dct_num_transfers(&self) -> usize; fn dct_value_by_index(&self, index: usize) -> Handle; fn token_by_index(&self, index: usize) -> Handle; fn dct_token_nonce_by_index(&self, index: usize) -> u64; fn dct_token_type_by_index(&self, index: usize) -> DctTokenType; // Provided methods fn require_moax(&self) -> Handle { ... } fn require_dct(&self, token: &[u8]) -> Handle { ... } fn payment_token_pair(&self) -> (Handle, Handle) { ... } fn get_all_dct_transfers<M: ManagedTypeApi>( &self ) -> ManagedVec<M, DctTokenPayment<M>> { ... }
}

Required Methods§

source

fn check_not_payable(&self)

source

fn moax_value(&self) -> Handle

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).

source

fn dct_value(&self) -> Handle

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).

source

fn token(&self) -> Handle

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.

source

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.

source

fn dct_token_type(&self) -> DctTokenType

Returns the DCT token type. Will return “Fungible” for MOAX.

source

fn dct_num_transfers(&self) -> usize

source

fn dct_value_by_index(&self, index: usize) -> Handle

source

fn token_by_index(&self, index: usize) -> Handle

source

fn dct_token_nonce_by_index(&self, index: usize) -> u64

source

fn dct_token_type_by_index(&self, index: usize) -> DctTokenType

Provided Methods§

source

fn require_moax(&self) -> Handle

Will return the MOAX call value, but also fail with an error if DCT is sent. Especially used in the auto-generated call value processing.

source

fn require_dct(&self, token: &[u8]) -> Handle

Will return the DCT call value, but also fail with an error if MOAX or the wrong DCT token is sent. Especially used in the auto-generated call value processing.

source

fn payment_token_pair(&self) -> (Handle, Handle)

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.

source

fn get_all_dct_transfers<M: ManagedTypeApi>( &self ) -> ManagedVec<M, DctTokenPayment<M>>

Object Safety§

This trait is not object safe.

Implementors§