multiversx_sc::types

Struct ContractCallWithEgld

Source
pub struct ContractCallWithEgld<SA, OriginalResult>
where SA: CallTypeApi + 'static,
{ pub basic: ContractCallNoPayment<SA, OriginalResult>, pub egld_payment: BigUint<SA>, }
👎Deprecated since 0.49.0: Please use the unified transaction syntax instead.
Expand description

Holds data for calling another contract, with EGLD payment only.

Gets created when chaining method with_egld_transfer.

If the payment is zero, it bevahes exactly like ContractCallNoPayment.

It also represents the normalized form of any contract call, since ESDT transfers (the only payment not available here) get converted to builtin function calls in normalized form.

Fields§

§basic: ContractCallNoPayment<SA, OriginalResult>
👎Deprecated since 0.49.0: Please use the unified transaction syntax instead.
§egld_payment: BigUint<SA>
👎Deprecated since 0.49.0: Please use the unified transaction syntax instead.

Implementations§

Source§

impl<SA, OriginalResult> ContractCallWithEgld<SA, OriginalResult>
where SA: CallTypeApi + 'static,

Source

pub fn convert_to_esdt_transfer_call( self, payments: ManagedVec<SA, EsdtTokenPayment<SA>>, ) -> Self

If this is an ESDT call, it converts it to a regular call to ESDTTransfer. Async calls require this step, but not transfer_esdt_execute.

Source§

impl<SA, OriginalResult> ContractCallWithEgld<SA, OriginalResult>
where SA: CallTypeApi + 'static,

Source§

impl<SA, OriginalResult> ContractCallWithEgld<SA, OriginalResult>
where SA: CallTypeApi + 'static,

Source

pub fn new<N: Into<ManagedBuffer<SA>>>( to: ManagedAddress<SA>, endpoint_name: N, egld_payment: BigUint<SA>, ) -> Self

Creates a new instance directly.

The constructor is mostly for hand-written proxies, the usual way of constructing this object is via the builder methods of other contract call types, especially with_egld_transfer.

Trait Implementations§

Source§

impl<SA, OriginalResult> ContractCall<SA> for ContractCallWithEgld<SA, OriginalResult>
where SA: CallTypeApi + 'static, OriginalResult: TopEncodeMulti,

Source§

fn transfer_execute(self)

Immediately launches a transfer-execute call. Read more
Source§

fn argument<T: TopEncodeMulti>(self, arg: &T) -> Self

Serializes and pushes a value to the arguments buffer. Read more
Source§

fn push_raw_argument<RawArg: Into<ManagedBuffer<SA>>>( &mut self, raw_arg: RawArg, )

For cases where we build the contract call by hand. Read more
Source§

fn with_raw_arguments(self, raw_argument_buffer: ManagedArgBuffer<SA>) -> Self

For cases where we build the contract call by hand.
Source§

fn with_gas_limit(self, gas_limit: u64) -> Self

Sets an explicit gas limit to the call.
Source§

fn into_call_data_string(self) -> ManagedBuffer<SA>

Source§

fn async_call(self) -> AsyncCall<SA>

Converts to a legacy async call.
Source§

fn async_call_promise(self) -> AsyncCallPromises<SA>

Converts to an async promise.
Source§

fn execute_on_dest_context<RequestedResult>(self) -> RequestedResult
where RequestedResult: TopDecodeMulti,

Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.
Source§

fn execute_on_dest_context_with_back_transfers<RequestedResult>( self, ) -> (RequestedResult, BackTransfers<SA>)
where RequestedResult: TopDecodeMulti,

Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.
Source§

fn execute_on_dest_context_ignore_result(self)

👎Deprecated since 0.36.1: Redundant method, use let _: IgnoreValue = contract_call.execute_on_dest_context(...) instead
Executes immediately, synchronously. Read more
Source§

fn execute_on_dest_context_readonly<RequestedResult>(self) -> RequestedResult
where RequestedResult: TopDecodeMulti,

Executes immediately, synchronously, and returns contract call result. Read more
Source§

fn execute_on_same_context<RequestedResult>(self) -> RequestedResult
where RequestedResult: TopDecodeMulti,

Executes immediately, synchronously, and returns contract call result. Read more
Source§

impl<SA, OriginalResult> ContractCallBase<SA> for ContractCallWithEgld<SA, OriginalResult>
where SA: CallTypeApi + 'static, OriginalResult: TopEncodeMulti,

Source§

type OriginalResult = OriginalResult

👎Deprecated since 0.49.0: Please use the unified transaction syntax instead.

Auto Trait Implementations§

§

impl<SA, OriginalResult> Freeze for ContractCallWithEgld<SA, OriginalResult>

§

impl<SA, OriginalResult> RefUnwindSafe for ContractCallWithEgld<SA, OriginalResult>

§

impl<SA, OriginalResult> Send for ContractCallWithEgld<SA, OriginalResult>
where SA: Send, OriginalResult: Send, <SA as HandleTypeInfo>::BigIntHandle: Send, <SA as HandleTypeInfo>::ManagedBufferHandle: Send,

§

impl<SA, OriginalResult> Sync for ContractCallWithEgld<SA, OriginalResult>
where SA: Sync, OriginalResult: Sync, <SA as HandleTypeInfo>::BigIntHandle: Sync, <SA as HandleTypeInfo>::ManagedBufferHandle: Sync,

§

impl<SA, OriginalResult> Unpin for ContractCallWithEgld<SA, OriginalResult>
where SA: Unpin, OriginalResult: Unpin, <SA as HandleTypeInfo>::BigIntHandle: Unpin, <SA as HandleTypeInfo>::ManagedBufferHandle: Unpin,

§

impl<SA, OriginalResult> UnwindSafe for ContractCallWithEgld<SA, OriginalResult>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.