-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmessages.fc
More file actions
79 lines (69 loc) · 2.14 KB
/
messages.fc
File metadata and controls
79 lines (69 loc) · 2.14 KB
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
{-
messages.func
Provides easy function to craft messages.
-}
const NORMAL = 0;
const PAID_EXTERNALLY = 1;
const IGNORE_ERRORS = 2;
const DESTROY_IF_ZERO = 32;
const CARRY_REMAINING_GAS = 64;
const CARRY_ALL_BALANCE = 128;
const ZERO_AMOUNT = 0;
() messages::send_empty(int amount, slice to, int mode) impure inline_ref {
cell msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(to)
.store_coins(amount)
.store_uint(0, 107)
.end_cell();
send_raw_message(msg, mode);
}
() messages::send_simple(int amount, slice to, cell body, int mode) impure inline_ref {
cell msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(to)
.store_coins(amount)
.store_uint(1, 107)
.store_ref(body)
.end_cell();
send_raw_message(msg, mode);
}
() messages::send_nobounce(int amount, slice to, cell body, int mode) impure inline_ref {
cell msg = begin_cell()
.store_uint(0x10, 6)
.store_slice(to)
.store_coins(amount)
.store_uint(1, 107)
.store_ref(body)
.end_cell();
send_raw_message(msg, mode);
}
() messages::send_with_stateinit(int amount, slice to, cell state_init, cell body, int mode) impure inline_ref {
cell msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(to)
.store_coins(amount)
.store_uint(7, 108)
.store_ref(state_init)
.store_ref(body)
.end_cell();
send_raw_message(msg, mode);
}
() messages::send_log(int query_id, int exit_code) impure inline_ref {
cell msg = begin_cell()
.store_uint(0x30, 6) ;; ext_out_msg_info$11 src:MsgAddressInt dest:MsgAddressExt
.store_uint(0, 64 + 32 + 1 + 1) ;; created_lt:uint64 created_at:uint32 init:(Maybe (Either StateInit ^StateInit)) body:(Either X ^X)
.store_uint(query_id, 64)
.store_uint(exit_code, 32)
.end_cell();
}
() messages::send_via_proxy(int amount, slice to, cell body, int mode) impure inline_ref {
cell msg = begin_cell()
.store_uint(0x10, 6)
.store_slice(to)
.store_coins(amount)
.store_uint(1, 107)
.store_ref(body)
.end_cell();
send_raw_message(msg, mode);
}