Ton

Форк
0
38 строк · 1.4 Кб
1
() send_receipt_message(addr, ans_tag, query_id, body, grams, mode) impure inline_ref {
2
  ;; int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool src:MsgAddress -> 011000
3
  var msg = begin_cell()
4
    .store_uint(0x18, 6)
5
    .store_slice(addr)
6
    .store_grams(grams)
7
    .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
8
    .store_uint(ans_tag, 32)
9
    .store_uint(query_id, 64);
10
  if (body >= 0) {
11
    msg~store_uint(body, 256);
12
  }
13
  send_raw_message(msg.end_cell(), mode);
14
}
15

16
() send_text_receipt_message(addr, grams, mode) impure inline_ref {
17
  ;; int_msg_info$0 ihr_disabled:Bool bounce:Bool bounced:Bool src:MsgAddress -> 011000
18
  var msg = begin_cell()
19
    .store_uint(0x18, 6)
20
    .store_slice(addr)
21
    .store_grams(grams)
22
    .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
23
    .store_uint(0, 32)
24
    .store_uint(0x4f4b, 16); ;; "OK"
25
  send_raw_message(msg.end_cell(), mode);
26
}
27

28
() emit_log_simple (int event_id, slice data) impure inline {
29
  var msg = begin_cell()
30
                        .store_uint (12, 4) ;; ext_out_msg_info$11 src:MsgAddressInt ()
31
                        .store_uint (1, 2)
32
                        .store_uint (256, 9)
33
                        .store_uint(event_id, 256)
34
                        .store_uint(0, 64 + 32 + 2) ;; created_lt, created_at, init:Maybe, body:Either
35
                        .store_slice(data)
36
           .end_cell();
37
  send_raw_message(msg, 0);
38
}
39

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.