Struct dharitri_wasm::types::ContractCall
source · pub struct ContractCall<SA, OriginalResult>where
SA: CallTypeApi + 'static,{
pub to: ManagedAddress<SA>,
pub moax_payment: BigUint<SA>,
pub payments: ManagedVec<SA, DctTokenPayment<SA>>,
pub endpoint_name: ManagedBuffer<SA>,
pub extra_gas_for_callback: u64,
pub explicit_gas_limit: u64,
pub arg_buffer: ManagedArgBuffer<SA>,
pub success_callback: &'static [u8],
pub error_callback: &'static [u8],
/* private fields */
}Expand description
Represents metadata for calling another contract. Can transform into either an async call, transfer call or other types of calls.
Fields§
§to: ManagedAddress<SA>§moax_payment: BigUint<SA>§payments: ManagedVec<SA, DctTokenPayment<SA>>§endpoint_name: ManagedBuffer<SA>§extra_gas_for_callback: u64§explicit_gas_limit: u64§arg_buffer: ManagedArgBuffer<SA>§success_callback: &'static [u8]§error_callback: &'static [u8]Implementations§
source§impl<SA, OriginalResult> ContractCall<SA, OriginalResult>where
SA: CallTypeApi + 'static,
impl<SA, OriginalResult> ContractCall<SA, OriginalResult>where
SA: CallTypeApi + 'static,
pub fn new(to: ManagedAddress<SA>, endpoint_name: ManagedBuffer<SA>) -> Self
pub fn new_with_dct_payment( to: ManagedAddress<SA>, endpoint_name: ManagedBuffer<SA>, payments: ManagedVec<SA, DctTokenPayment<SA>> ) -> Self
pub fn add_dct_token_transfer( self, payment_token: TokenIdentifier<SA>, payment_nonce: u64, payment_amount: BigUint<SA> ) -> Self
pub fn with_moax_or_single_dct_token_transfer( self, payment_token: MoaxOrDctTokenIdentifier<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<T: TopEncodeMulti>(&mut self, endpoint_arg: &T)
sourcepub fn convert_to_dct_transfer_call(self) -> Self
pub fn convert_to_dct_transfer_call(self) -> Self
If this is an DCT call, it converts it to a regular call to DCTTransfer.
Async calls require this step, but not transfer_dct_execute.
pub fn resolve_gas_limit(&self) -> u64
pub fn async_call(self) -> AsyncCall<SA>
source§impl<SA, OriginalResult> ContractCall<SA, OriginalResult>where
SA: CallTypeApi + 'static,
OriginalResult: TopEncodeMulti,
impl<SA, OriginalResult> ContractCall<SA, OriginalResult>where
SA: CallTypeApi + 'static,
OriginalResult: TopEncodeMulti,
sourcepub fn execute_on_dest_context<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
pub fn execute_on_dest_context<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.
pub fn execute_on_dest_context_readonly<RequestedResult>(
self
) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
pub fn execute_on_same_context<RequestedResult>(self) -> RequestedResultwhere
RequestedResult: TopDecodeMulti,
source§impl<SA, OriginalResult> ContractCall<SA, OriginalResult>where
SA: CallTypeApi + 'static,
impl<SA, OriginalResult> ContractCall<SA, OriginalResult>where
SA: CallTypeApi + 'static,
sourcepub fn execute_on_dest_context_ignore_result(self)
👎Deprecated since 0.10.6: Redundant method, use let _: IgnoreValue = contract_call.execute_on_dest_context(...) instead
pub fn execute_on_dest_context_ignore_result(self)
let _: IgnoreValue = contract_call.execute_on_dest_context(...) insteadExecutes immediately, synchronously.
The result (if any) is ignored.
Deprecated and will be removed soon. Use let _: IgnoreValue = contract_call.execute_on_dest_context(...) instead.
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.