1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
use super::BigUintApi;
use crate::types::{Address, ArgBuffer, BoxedBytes, CodeMetadata, TokenIdentifier};
const DIRECT_ESDT_GAS_LIMIT: u64 = 0;
pub trait SendApi<BigUint>: Sized
where
BigUint: BigUintApi + 'static,
{
fn direct_egld(&self, to: &Address, amount: &BigUint, data: &[u8]);
#[inline]
fn direct_esdt(&self, to: &Address, token: &[u8], amount: &BigUint, data: &[u8]) {
self.direct_esdt_explicit_gas_limit(to, token, amount, DIRECT_ESDT_GAS_LIMIT, data);
}
fn direct_esdt_explicit_gas_limit(
&self,
to: &Address,
token: &[u8],
amount: &BigUint,
gas_limit: u64,
data: &[u8],
);
fn direct(&self, to: &Address, token: &TokenIdentifier, amount: &BigUint, data: &[u8]) {
if token.is_egld() {
self.direct_egld(to, amount, data);
} else {
self.direct_esdt(to, token.as_slice(), amount, data);
}
}
fn async_call_raw(&self, to: &Address, amount: &BigUint, data: &[u8]) -> !;
fn deploy_contract(
&self,
gas: u64,
amount: &BigUint,
code: &BoxedBytes,
code_metadata: CodeMetadata,
arg_buffer: &ArgBuffer,
) -> Address;
fn execute_on_dest_context(
&self,
gas: u64,
address: &Address,
value: &BigUint,
function: &[u8],
arg_buffer: &ArgBuffer,
);
fn execute_on_dest_context_by_caller(
&self,
gas: u64,
address: &Address,
value: &BigUint,
function: &[u8],
arg_buffer: &ArgBuffer,
);
fn execute_on_same_context(
&self,
gas: u64,
address: &Address,
value: &BigUint,
function: &[u8],
arg_buffer: &ArgBuffer,
);
}