multiversx_sc::contract_base

Struct SendRawWrapper

Source
pub struct SendRawWrapper<A>
where A: CallTypeApi,
{ /* private fields */ }

Implementations§

Source§

impl<A> SendRawWrapper<A>
where A: CallTypeApi,

Source

pub fn new() -> Self

Source

pub fn direct_egld<D>( &self, to: &ManagedAddress<A>, egld_value: &BigUint<A>, data: D, )
where D: Into<ManagedBuffer<A>>,

Source

pub fn direct_egld_execute( &self, to: &ManagedAddress<A>, egld_value: &BigUint<A>, gas_limit: u64, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> Result<(), &'static [u8]>

Source

pub fn transfer_esdt_execute( &self, to: &ManagedAddress<A>, token: &TokenIdentifier<A>, value: &BigUint<A>, gas_limit: u64, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> Result<(), &'static [u8]>

Source

pub fn transfer_esdt_nft_execute( &self, to: &ManagedAddress<A>, token: &TokenIdentifier<A>, nonce: u64, egld_value: &BigUint<A>, gas_limit: u64, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> Result<(), &'static [u8]>

Source

pub fn multi_esdt_transfer_execute( &self, to: &ManagedAddress<A>, payments: &ManagedVec<A, EsdtTokenPayment<A>>, gas_limit: u64, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> Result<(), &'static [u8]>

Source

pub fn multi_egld_or_esdt_transfer_execute( &self, to: &ManagedAddress<A>, payments: &ManagedVec<A, EgldOrEsdtTokenPayment<A>>, gas_limit: u64, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> Result<(), &'static [u8]>

Source

pub fn async_call_raw( &self, to: &ManagedAddress<A>, egld_value: &BigUint<A>, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> !

Source

pub fn create_async_call_raw( &self, to: &ManagedAddress<A>, egld_value: &BigUint<A>, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, success_callback: &'static str, error_callback: &'static str, gas: u64, extra_gas_for_callback: u64, serialized_callback_closure_args: &ManagedBuffer<A>, )

Source

pub fn deploy_contract( &self, gas: u64, egld_value: &BigUint<A>, code: &ManagedBuffer<A>, code_metadata: CodeMetadata, arg_buffer: &ManagedArgBuffer<A>, ) -> (ManagedAddress<A>, ManagedVec<A, ManagedBuffer<A>>)

Deploys a new contract in the same shard. Unlike async_call_raw, the deployment is synchronous and tx execution continues afterwards. Also unlike async_call_raw, it uses an argument buffer to pass arguments If the deployment fails, Option::None is returned

Source

pub fn deploy_from_source_contract( &self, gas: u64, egld_value: &BigUint<A>, source_contract_address: &ManagedAddress<A>, code_metadata: CodeMetadata, arg_buffer: &ManagedArgBuffer<A>, ) -> (ManagedAddress<A>, ManagedVec<A, ManagedBuffer<A>>)

Deploys a new contract in the same shard by re-using the code of an already deployed source contract. The deployment is done synchronously and the new contract’s address is returned. If the deployment fails, Option::None is returned

Source

pub fn upgrade_from_source_contract( &self, sc_address: &ManagedAddress<A>, gas: u64, egld_value: &BigUint<A>, source_contract_address: &ManagedAddress<A>, code_metadata: CodeMetadata, arg_buffer: &ManagedArgBuffer<A>, )

Source

pub fn upgrade_contract( &self, sc_address: &ManagedAddress<A>, gas: u64, egld_value: &BigUint<A>, code: &ManagedBuffer<A>, code_metadata: CodeMetadata, arg_buffer: &ManagedArgBuffer<A>, )

Upgrades a child contract of the currently executing contract. The upgrade is synchronous, and the current transaction will fail if the upgrade fails. The child contract’s new init function will be called with the provided arguments

Source

pub fn execute_on_dest_context_raw( &self, gas: u64, address: &ManagedAddress<A>, value: &BigUint<A>, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> ManagedVec<A, ManagedBuffer<A>>

Same shard, in-line execution of another contract.

Source

pub fn execute_on_same_context_raw( &self, gas: u64, address: &ManagedAddress<A>, value: &BigUint<A>, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> ManagedVec<A, ManagedBuffer<A>>

Source

pub fn execute_on_dest_context_readonly_raw( &self, gas: u64, address: &ManagedAddress<A>, endpoint_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> ManagedVec<A, ManagedBuffer<A>>

Same shard, in-line execution of another contract.

Source

pub fn call_local_esdt_built_in_function( &self, gas: u64, function_name: &ManagedBuffer<A>, arg_buffer: &ManagedArgBuffer<A>, ) -> ManagedVec<A, ManagedBuffer<A>>

Allows synchronously calling a local function by name. Execution is resumed afterwards.

Source

pub fn clean_return_data(&self)

Trait Implementations§

Source§

impl<A> Default for SendRawWrapper<A>
where A: CallTypeApi + Default,

Source§

fn default() -> SendRawWrapper<A>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<A> Freeze for SendRawWrapper<A>

§

impl<A> RefUnwindSafe for SendRawWrapper<A>
where A: RefUnwindSafe,

§

impl<A> Send for SendRawWrapper<A>
where A: Send,

§

impl<A> Sync for SendRawWrapper<A>
where A: Sync,

§

impl<A> Unpin for SendRawWrapper<A>
where A: Unpin,

§

impl<A> UnwindSafe for SendRawWrapper<A>
where A: UnwindSafe,

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.