use super::{BlockchainApi, HandleTypeInfo, ManagedTypeApi, ManagedTypeApiImpl, RawHandle};
pub trait SendApi: ManagedTypeApi + BlockchainApi {
type SendApiImpl: SendApiImpl
+ HandleTypeInfo<
ManagedBufferHandle = Self::ManagedBufferHandle,
BigIntHandle = Self::BigIntHandle,
BigFloatHandle = Self::BigFloatHandle,
EllipticCurveHandle = Self::EllipticCurveHandle,
>;
fn send_api_impl() -> Self::SendApiImpl;
}
pub trait SendApiImpl: ManagedTypeApiImpl {
fn transfer_value_execute(
&self,
to_handle: RawHandle,
egld_value_handle: RawHandle,
gas_limit: u64,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
) -> Result<(), &'static [u8]>;
fn multi_transfer_esdt_nft_execute(
&self,
to_handle: RawHandle,
payments_handle: RawHandle,
gas_limit: u64,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
) -> Result<(), &'static [u8]>;
fn async_call_raw(
&self,
to_handle: RawHandle,
egld_value_handle: RawHandle,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
) -> !;
#[allow(clippy::too_many_arguments)]
fn create_async_call_raw(
&self,
to_handle: RawHandle,
egld_value_handle: RawHandle,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
success_callback: &'static str,
error_callback: &'static str,
gas: u64,
extra_gas_for_callback: u64,
callback_closure: RawHandle,
);
#[allow(clippy::too_many_arguments)]
fn deploy_contract(
&self,
gas: u64,
egld_value_handle: RawHandle,
code_handle: RawHandle,
code_metadata_handle: RawHandle,
arg_buffer_handle: RawHandle,
new_address_handle: RawHandle,
result_handle: RawHandle,
);
#[allow(clippy::too_many_arguments)]
fn deploy_from_source_contract(
&self,
gas: u64,
egld_value_handle: RawHandle,
source_contract_address_handle: RawHandle,
code_metadata_handle: RawHandle,
arg_buffer_handle: RawHandle,
new_address_handle: RawHandle,
result_handle: RawHandle,
);
fn upgrade_from_source_contract(
&self,
sc_address_handle: RawHandle,
gas: u64,
egld_value_handle: RawHandle,
source_contract_address_handle: RawHandle,
code_metadata_handle: RawHandle,
arg_buffer_handle: RawHandle,
);
fn upgrade_contract(
&self,
sc_address_handle: RawHandle,
gas: u64,
egld_value_handle: RawHandle,
code_handle: RawHandle,
code_metadata_handle: RawHandle,
arg_buffer_handle: RawHandle,
);
fn execute_on_dest_context_raw(
&self,
gas: u64,
address_handle: RawHandle,
egld_value_handle: RawHandle,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
result_handle: RawHandle,
);
fn execute_on_same_context_raw(
&self,
gas: u64,
address_handle: RawHandle,
egld_value_handle: RawHandle,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
result_handle: RawHandle,
);
fn execute_on_dest_context_readonly_raw(
&self,
gas: u64,
address_handle: RawHandle,
endpoint_name_handle: RawHandle,
arg_buffer_handle: RawHandle,
result_handle: RawHandle,
);
fn clean_return_data(&self);
fn delete_from_return_data(&self, index: usize);
}