Struct dharitri_wasm::types::ContractCall
source · pub struct ContractCall<SA, R>where
SA: SendApi + 'static,{ /* private fields */ }Expand description
Represents metadata for calling another contract. Can transform into either an async call, transfer call or other types of calls.
Implementations§
source§impl<SA, R> ContractCall<SA, R>where
SA: SendApi + 'static,
impl<SA, R> ContractCall<SA, R>where
SA: SendApi + 'static,
pub fn new( api: SA, to: ManagedAddress<SA>, endpoint_name: ManagedBuffer<SA> ) -> Self
pub fn new_with_dct_payment( api: SA, to: ManagedAddress<SA>, endpoint_name: ManagedBuffer<SA>, payments: ManagedVec<SA, DctTokenPayment<SA>> ) -> Self
pub fn add_token_transfer( self, payment_token: TokenIdentifier<SA>, payment_nonce: u64, payment_amount: BigUint<SA> ) -> Self
pub fn with_moax_transfer(self, moax_amount: BigUint<SA>) -> Self
pub fn with_multi_token_transfer( self, payments: ManagedVec<SA, DctTokenPayment<SA>> ) -> Self
pub fn with_gas_limit(self, gas_limit: u64) -> Self
pub fn with_arguments_raw( self, raw_argument_buffer: ManagedArgBuffer<SA> ) -> Self
sourcepub fn push_arg_managed_buffer(&mut self, m_buffer: ManagedBuffer<SA>)
pub fn push_arg_managed_buffer(&mut self, m_buffer: ManagedBuffer<SA>)
Provided for cases where we build the contract call by hand.
sourcepub fn push_argument_raw_bytes(&mut self, bytes: &[u8])
pub fn push_argument_raw_bytes(&mut self, bytes: &[u8])
Provided for cases where we build the contract call by hand. Convenience method, also creates the new managed buffer from bytes.
pub fn push_endpoint_arg<D: ContractCallArg>(&mut self, endpoint_arg: D)
pub fn async_call(self) -> AsyncCall<SA>
source§impl<SA, R> ContractCall<SA, R>
impl<SA, R> ContractCall<SA, R>
sourcepub fn execute_on_dest_context(self) -> R
pub fn execute_on_dest_context(self) -> R
Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.
sourcepub fn execute_on_dest_context_custom_range<F>(self, range_closure: F) -> R
pub fn execute_on_dest_context_custom_range<F>(self, range_closure: F) -> R
Executes immediately, synchronously, and returns contract call result.
Only works if the target contract is in the same shard.
This is a workaround to handle nested sync calls.
Please do not use this method unless there is absolutely no other option.
Will be eliminated after some future Arwen hook redesign.
range_closure takes the number of results before, the number of results after,
and is expected to return the start index (inclusive) and end index (exclusive).
pub fn execute_on_dest_context_readonly(self) -> R
source§impl<SA, R> ContractCall<SA, R>where
SA: SendApi + 'static,
impl<SA, R> ContractCall<SA, R>where
SA: SendApi + 'static,
sourcepub fn execute_on_dest_context_ignore_result(self)
pub fn execute_on_dest_context_ignore_result(self)
Executes immediately, synchronously. The result (if any) is ignored. Only works if the target contract is in the same shard.
pub fn execute_on_same_context(self)
sourcepub fn transfer_execute(self)
pub fn transfer_execute(self)
Immediately launches a transfer-execute call. This is similar to an async call, but there is no callback and there can be more than one such call per transaction.