everscale-client-ruby 1.1.43 → 1.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2aefe3210301515144c6f4302e4788c1f145341805663f5a100cfacce5990ed4
4
- data.tar.gz: 7dc12fd1d4e919dfd47d505c17913e99da16f987cc7af19340c9355c1cc81897
3
+ metadata.gz: 9ef18c6e5ec06aec7b4d2a5469980f3ba4a14d74122a72ee66f64138e08f87d8
4
+ data.tar.gz: ca752bcc10ae424fdf22fc8d26809df20cf9e030078bf828fa0c814fb61e0334
5
5
  SHA512:
6
- metadata.gz: bbb3f882bf2a878187b91cb1a87391eaa5ab7339280899f3c74254e13e68fe363eca05f154b35bd5123bae347c6dfc37c9d96317196eb17d25851be16cf245e6
7
- data.tar.gz: 2669d48d4d0fe9f840c774c61279357ebd74ff01bb960e1a0c20ecaa5bb172dadda9f2e67212f8794c4f027a6e9238f9e9bafe8f553922c4c9b8596374d9dd2f
6
+ metadata.gz: a51eb6ea6dc7624e8583bac6c886a58085ac49cbb38d298a8f9dc24da84506acc89338c0d1178b93ddb3f9a605f2e296a57427c265a00cc4bedcbfb8cdda0861
7
+ data.tar.gz: 2add7a7abf6a257a925bc40a4670a8579e6d89580753681811ac40458eb34ea427bc9ea51faa315f4b831a3e6ffeb18b3dcf81d4f797ebdacd92356c15f7f4aa
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.37.1",
2
+ "version": "1.37.2",
3
3
  "modules": [
4
4
  {
5
5
  "name": "client",
@@ -540,7 +540,7 @@
540
540
  "type": "String"
541
541
  },
542
542
  "summary": "Access key to GraphQL API.",
543
- "description": "You can specify here Evercloud project secret ot serialized JWT."
543
+ "description": "You can specify here Basic Auth secret (Evercloud project secret) in hex string\nor serialized JWT in base64 string.\nWill be passed on as Authorization: Basic ... or Authorization: Bearer ... header."
544
544
  }
545
545
  ],
546
546
  "summary": null,
@@ -1310,29 +1310,61 @@
1310
1310
  "enum_types": [
1311
1311
  {
1312
1312
  "name": "AES",
1313
- "type": "Ref",
1314
- "ref_name": "crypto.AesParamsEB",
1313
+ "type": "Struct",
1314
+ "struct_fields": [
1315
+ {
1316
+ "name": "value",
1317
+ "type": "Ref",
1318
+ "ref_name": "crypto.AesParamsEB",
1319
+ "summary": null,
1320
+ "description": null
1321
+ }
1322
+ ],
1315
1323
  "summary": null,
1316
1324
  "description": null
1317
1325
  },
1318
1326
  {
1319
1327
  "name": "ChaCha20",
1320
- "type": "Ref",
1321
- "ref_name": "crypto.ChaCha20ParamsEB",
1328
+ "type": "Struct",
1329
+ "struct_fields": [
1330
+ {
1331
+ "name": "value",
1332
+ "type": "Ref",
1333
+ "ref_name": "crypto.ChaCha20ParamsEB",
1334
+ "summary": null,
1335
+ "description": null
1336
+ }
1337
+ ],
1322
1338
  "summary": null,
1323
1339
  "description": null
1324
1340
  },
1325
1341
  {
1326
1342
  "name": "NaclBox",
1327
- "type": "Ref",
1328
- "ref_name": "crypto.NaclBoxParamsEB",
1343
+ "type": "Struct",
1344
+ "struct_fields": [
1345
+ {
1346
+ "name": "value",
1347
+ "type": "Ref",
1348
+ "ref_name": "crypto.NaclBoxParamsEB",
1349
+ "summary": null,
1350
+ "description": null
1351
+ }
1352
+ ],
1329
1353
  "summary": null,
1330
1354
  "description": null
1331
1355
  },
1332
1356
  {
1333
1357
  "name": "NaclSecretBox",
1334
- "type": "Ref",
1335
- "ref_name": "crypto.NaclSecretBoxParamsEB",
1358
+ "type": "Struct",
1359
+ "struct_fields": [
1360
+ {
1361
+ "name": "value",
1362
+ "type": "Ref",
1363
+ "ref_name": "crypto.NaclSecretBoxParamsEB",
1364
+ "summary": null,
1365
+ "description": null
1366
+ }
1367
+ ],
1336
1368
  "summary": null,
1337
1369
  "description": null
1338
1370
  }
@@ -1588,22 +1620,46 @@
1588
1620
  "enum_types": [
1589
1621
  {
1590
1622
  "name": "ChaCha20",
1591
- "type": "Ref",
1592
- "ref_name": "crypto.ChaCha20ParamsCB",
1623
+ "type": "Struct",
1624
+ "struct_fields": [
1625
+ {
1626
+ "name": "value",
1627
+ "type": "Ref",
1628
+ "ref_name": "crypto.ChaCha20ParamsCB",
1629
+ "summary": null,
1630
+ "description": null
1631
+ }
1632
+ ],
1593
1633
  "summary": null,
1594
1634
  "description": null
1595
1635
  },
1596
1636
  {
1597
1637
  "name": "NaclBox",
1598
- "type": "Ref",
1599
- "ref_name": "crypto.NaclBoxParamsCB",
1638
+ "type": "Struct",
1639
+ "struct_fields": [
1640
+ {
1641
+ "name": "value",
1642
+ "type": "Ref",
1643
+ "ref_name": "crypto.NaclBoxParamsCB",
1644
+ "summary": null,
1645
+ "description": null
1646
+ }
1647
+ ],
1600
1648
  "summary": null,
1601
1649
  "description": null
1602
1650
  },
1603
1651
  {
1604
1652
  "name": "NaclSecretBox",
1605
- "type": "Ref",
1606
- "ref_name": "crypto.NaclSecretBoxParamsCB",
1653
+ "type": "Struct",
1654
+ "struct_fields": [
1655
+ {
1656
+ "name": "value",
1657
+ "type": "Ref",
1658
+ "ref_name": "crypto.NaclSecretBoxParamsCB",
1659
+ "summary": null,
1660
+ "description": null
1661
+ }
1662
+ ],
1607
1663
  "summary": null,
1608
1664
  "description": null
1609
1665
  }
@@ -234,18 +234,21 @@ cd everscale-client-ruby\n
234
234
 
235
235
  private def generateClientModule(mod, modules)
236
236
  content = "module TonClient\n\n#{TAB}class #{mod.name.capitalize}\n#{TAB}#{TAB}include CommonInstanceHelpers\n\n"
237
- content << "#{TAB}#{TAB}attr_reader :core, :context\n"
237
+ content << "#{TAB}#{TAB}attr_reader :context, :context_config\n"
238
238
  content << "#{TAB}#{TAB}private_accessor "
239
239
  modules.each_with_index do |m, i|
240
240
  next if m.name.downcase == 'client'
241
241
  content << ((modules.size - 1) == i ? ":_#{m.name}\n" : ":_#{m.name}, ")
242
242
  end
243
243
  content << "#{TAB}#{TAB}MODULE = self.to_s.downcase.gsub(/^(.+::|)(\\w+)$/, '\\2').freeze\n\n"
244
- content << "#{TAB}#{TAB}def initialize(context: Context.new, core: TonClient::TonBinding)\n"
245
- content << "#{TAB}#{TAB}#{TAB}@context = context\n"
246
- content << "#{TAB}#{TAB}#{TAB}@core = core\n#{TAB}#{TAB}end\n\n"
244
+ content << "#{TAB}#{TAB}def initialize(context_config: {})\n"
245
+ content << "#{TAB}#{TAB}#{TAB}@context_config = context_config\n"
246
+ content << "#{TAB}#{TAB}#{TAB}config = TonBinding.make_string(context_config.to_json)\n"
247
+ content << "#{TAB}#{TAB}#{TAB}context_ptr = TonBinding.tc_create_context(config)\n"
248
+ content << "#{TAB}#{TAB}#{TAB}@context = TonBinding.read_string_to_hash(context_ptr)['result']\n"
249
+ content << "#{TAB}#{TAB}end\n\n"
247
250
  content << "#{TAB}#{TAB}def destroy_context\n"
248
- content << "#{TAB}#{TAB}#{TAB}core.tc_destroy_context(context.id)\n#{TAB}#{TAB}end\n\n"
251
+ content << "#{TAB}#{TAB}#{TAB}TonBinding.tc_destroy_context(context)\n#{TAB}#{TAB}end\n\n"
249
252
  modules.each_with_index do |m, i|
250
253
  next if m.name.downcase == 'client'
251
254
  content << "#{TAB}#{TAB}def #{m.name}\n"
@@ -265,11 +268,10 @@ cd everscale-client-ruby\n
265
268
 
266
269
  private def generateModule(mod)
267
270
  content = "module TonClient\n\n#{TAB}class #{mod.name.capitalize}\n#{TAB}#{TAB}include CommonInstanceHelpers\n\n"
268
- content << "#{TAB}#{TAB}attr_reader :core, :context\n"
271
+ content << "#{TAB}#{TAB}attr_reader :context\n"
269
272
  content << "#{TAB}#{TAB}MODULE = self.to_s.downcase.gsub(/^(.+::|)(\\w+)$/, '\\2').freeze\n\n"
270
- content << "#{TAB}#{TAB}def initialize(context: Context.new, core: TonClient::TonBinding)\n"
273
+ content << "#{TAB}#{TAB}def initialize(context: nil)\n"
271
274
  content << "#{TAB}#{TAB}#{TAB}@context = context\n"
272
- content << "#{TAB}#{TAB}#{TAB}@core = core\n"
273
275
  content << "#{TAB}#{TAB}end\n\n"
274
276
 
275
277
  mod.functions.each do |func|
@@ -287,10 +289,10 @@ cd everscale-client-ruby\n
287
289
  content << "#{TAB}#{TAB}def #{function.name}"
288
290
  if function.arguments.empty?
289
291
  content << "(&block)\n"
290
- content << "#{TAB}#{TAB}#{TAB}core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)\n"
292
+ content << "#{TAB}#{TAB}#{TAB}TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)\n"
291
293
  else
292
294
  content << "(payload, &block)\n"
293
- content << "#{TAB}#{TAB}#{TAB}core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)\n"
295
+ content << "#{TAB}#{TAB}#{TAB}TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)\n"
294
296
  end
295
297
  content << "#{TAB}#{TAB}end\n\n"
296
298
 
@@ -1,21 +1,24 @@
1
+ require 'byebug'
2
+
1
3
  module TonClient
2
4
  module TonBinding
3
- @@request_id = 0
4
- @@requests = {}
5
+ @@request_id = Concurrent::AtomicFixnum.new(1)
6
+ @@requests = Concurrent::Hash.new()
5
7
 
6
8
  class Response
7
- attr_reader :core
8
9
  attr_accessor :result, :error, :custom_response, :finished, :request_id, :current_response
9
10
 
10
- def initialize(core: TonClient::TonBinding)
11
- @core = core
11
+ def initialize(request_id, string_data, response_type, finished)
12
+ update(request_id, string_data, response_type, finished)
12
13
  end
13
14
 
15
+ private
14
16
  def update(request_id, string_data, response_type, finished)
15
- response_hash = core.read_string_to_hash(string_data)
17
+ response_hash = TonBinding.read_string_to_hash(string_data)
16
18
  self.finished = finished
17
19
  self.request_id = request_id
18
20
  self.current_response = response_hash
21
+
19
22
  case response_type
20
23
  when 0
21
24
  # result
@@ -29,25 +32,27 @@ module TonClient
29
32
  self.custom_responses = response_hash
30
33
  end
31
34
  end
35
+
36
+ self
32
37
  end
33
38
  end
34
39
 
35
40
  def self.generate_request_id
36
- @@request_id = 0 if @@request_id == 4294967295
37
- @@request_id += 1
41
+ @@request_id.increment()
42
+ @@request_id.value
38
43
  end
39
44
 
40
45
  def self.get_request(id)
41
46
  @@requests[id]
42
47
  end
43
48
 
44
- def self.delete_request(id)
45
- @@requests[id] = nil
46
- end
47
-
48
49
  def self.set_request(id, &request_block)
49
50
  @@requests[id] = request_block
50
51
  end
52
+
53
+ def self.delete_request(id)
54
+ @@requests[id] = nil
55
+ end
51
56
  end
52
57
  end
53
58
 
@@ -56,18 +61,19 @@ module TonClient
56
61
 
57
62
  module TonBinding
58
63
  extend FFI::Library
59
- ffi_lib FFI::Library::LIBC
64
+ # ffi_lib FFI::Library::LIBC
65
+ # ffi_lib 'ruby'
60
66
 
61
67
  # memory allocators
62
- attach_function :malloc, [:size_t], :pointer
63
- attach_function :calloc, [:size_t], :pointer
64
- attach_function :valloc, [:size_t], :pointer
65
- attach_function :realloc, [:pointer, :size_t], :pointer
66
- attach_function :free, [:pointer], :void
68
+ # attach_function :malloc, [:size_t], :pointer
69
+ # attach_function :calloc, [:size_t], :pointer
70
+ # attach_function :valloc, [:size_t], :pointer
71
+ # attach_function :realloc, [:pointer, :size_t], :pointer
72
+ # attach_function :free, [:pointer], :void
67
73
 
68
- # memory movers
69
- attach_function :memcpy, [:pointer, :pointer, :size_t], :pointer
70
- attach_function :bcopy, [:pointer, :pointer, :size_t], :void
74
+ # # memory movers
75
+ # attach_function :memcpy, [:pointer, :pointer, :size_t], :pointer
76
+ # attach_function :bcopy, [:pointer, :pointer, :size_t], :void
71
77
 
72
78
  def self.setup_bindings
73
79
 
@@ -116,28 +122,21 @@ module TonClient
116
122
  end
117
123
 
118
124
  def self.make_string(string)
125
+ # p 1
119
126
  result = TonBinding::TcStringDataT.new
120
- result[:content] = FFI::MemoryPointer.from_string(string)
121
- result[:len] = string.bytesize
127
+ bytes_count = string.unpack("C*").size
128
+ ptr1 = FFI::MemoryPointer.new(:char, bytes_count)
129
+ ptr1.put_bytes(0, string, 0, bytes_count)
130
+ # ptr1.autorelease = false
131
+ # p ptr1.autorelease?
132
+ result[:content] = ptr1
133
+ # result[:content] = FFI::MemoryPointer.from_string(string)
134
+ # result[:len] = string.bytesize
135
+ result[:len] = ptr1.size
136
+ # p 2
122
137
  result
123
138
  end
124
139
 
125
- # def self.read_string(tc_string_handle)
126
- # is_ref = tc_string_handle.class == TonClient::TonBinding::TcStringHandleT
127
- # if is_ref
128
- # string = tc_read_string(tc_string_handle)
129
- # else
130
- # string = tc_string_handle
131
- # end
132
-
133
- # if string[:content].address > 1
134
- # string = string[:content].read_string(string[:len]).force_encoding('UTF-8') + ''
135
- # tc_destroy_string(tc_string_handle) if is_ref
136
- # return string
137
- # end
138
- # nil
139
- # end
140
-
141
140
  def self.read_string(tc_string_handle)
142
141
  is_ref = tc_string_handle.class == FFI::Pointer
143
142
  if is_ref
@@ -147,8 +146,11 @@ module TonClient
147
146
  end
148
147
 
149
148
  if string[:content].address > 1
150
- string = string[:content].read_string(string[:len]).force_encoding('UTF-8') + ''
151
- tc_destroy_string(tc_string_handle) if is_ref
149
+ string = string[:content].read_string(string[:len])
150
+ if is_ref
151
+ tc_destroy_string(tc_string_handle)
152
+ # free(tc_string_handle)
153
+ end
152
154
  return string
153
155
  end
154
156
  nil
@@ -173,26 +175,19 @@ module TonClient
173
175
  return response['error'] if response['error']
174
176
  end
175
177
 
176
- def self.send_request(context: 1, method_name: '', payload: {}, request_id: 1, &block)
178
+ # block = { |response| }
179
+ def self.requestLibrary(context: 1, method_name: '', payload: {}, &block)
177
180
  raise 'context not found' unless context
178
181
  raise 'method_name is empty' if method_name.empty?
179
182
 
180
- if block
181
- method_name_string = make_string(method_name)
182
- payload_string = make_string(payload.to_json)
183
- tc_request(context, method_name_string, payload_string, request_id, &block)
184
- end
185
- end
186
-
187
- # block = { |response| }
188
- def self.requestLibrary(context: 1, method_name: '', payload: {}, &block)
189
183
  request_id = generate_request_id
184
+ method_name_string = make_string(method_name)
185
+ payload_string = make_string(payload.to_json)
190
186
  set_request(request_id, &block)
191
- send_request(context: context, method_name: method_name, payload: payload, request_id: request_id) do |request_id, string_data, response_type, finished|
192
- if get_request(request_id)
193
- response = Response.new
194
- response.update(request_id, string_data, response_type, finished)
195
- get_request(request_id).call(response)
187
+ tc_request(context, method_name_string, payload_string, request_id) do |request_id, string_data, response_type, finished|
188
+ request = get_request(request_id)
189
+ if request
190
+ request.call(Response.new(request_id, string_data, response_type, finished))
196
191
  delete_request(request_id) if finished
197
192
  end
198
193
  end
@@ -9,13 +9,5 @@ module TonClient
9
9
  layout :content, :pointer,
10
10
  :len, :uint32
11
11
  end
12
-
13
-
14
- # typedef struct {
15
- # } tc_string_handle_t;
16
- class TcStringHandleT < FFI::Struct
17
- layout :content, :pointer,
18
- :len, :uint32
19
- end
20
12
  end
21
13
  end
@@ -3,12 +3,11 @@ module TonClient
3
3
  class Abi
4
4
  include CommonInstanceHelpers
5
5
 
6
- attr_reader :core, :context
6
+ attr_reader :context
7
7
  MODULE = self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
8
8
 
9
- def initialize(context: Context.new, core: TonClient::TonBinding)
9
+ def initialize(context: nil)
10
10
  @context = context
11
- @core = core
12
11
  end
13
12
 
14
13
  # INPUT: ParamsOfEncodeMessageBody
@@ -27,7 +26,7 @@ module TonClient
27
26
  # data_to_sign: String<Optional> - # # Optional data to sign. # # Encoded with `base64`.
28
27
  # # Presents when `message` is unsigned. Can be used for externalmessage signing. Is this case you need to sing this data andproduce signed message using `abi.attach_signature`.
29
28
  def encode_message_body(payload, &block)
30
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
29
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
31
30
  end
32
31
 
33
32
  # INPUT: ParamsOfAttachSignatureToMessageBody
@@ -38,7 +37,7 @@ module TonClient
38
37
  # RESPONSE: ResultOfAttachSignatureToMessageBody
39
38
  # body: String -
40
39
  def attach_signature_to_message_body(payload, &block)
41
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
40
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
42
41
  end
43
42
 
44
43
  # INPUT: ParamsOfEncodeMessage
@@ -59,7 +58,7 @@ module TonClient
59
58
  # address: String - # # Destination address.
60
59
  # message_id: String - # # Message id.
61
60
  def encode_message(payload, &block)
62
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
61
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
63
62
  end
64
63
 
65
64
  # INPUT: ParamsOfEncodeInternalMessage
@@ -77,7 +76,7 @@ module TonClient
77
76
  # address: String - # # Destination address.
78
77
  # message_id: String - # # Message id.
79
78
  def encode_internal_message(payload, &block)
80
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
79
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
81
80
  end
82
81
 
83
82
  # INPUT: ParamsOfAttachSignature
@@ -89,7 +88,7 @@ module TonClient
89
88
  # message: String - # # Signed message BOC
90
89
  # message_id: String - # # Message ID
91
90
  def attach_signature(payload, &block)
92
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
91
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
93
92
  end
94
93
 
95
94
  # INPUT: ParamsOfDecodeMessage
@@ -102,7 +101,7 @@ module TonClient
102
101
  # value: Value<Optional> - # # Parameters or result value.
103
102
  # header: FunctionHeader<Optional> - # # Function header.
104
103
  def decode_message(payload, &block)
105
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
104
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
106
105
  end
107
106
 
108
107
  # INPUT: ParamsOfDecodeMessageBody
@@ -116,7 +115,7 @@ module TonClient
116
115
  # value: Value<Optional> - # # Parameters or result value.
117
116
  # header: FunctionHeader<Optional> - # # Function header.
118
117
  def decode_message_body(payload, &block)
119
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
118
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
120
119
  end
121
120
 
122
121
  # INPUT: ParamsOfEncodeAccount
@@ -129,7 +128,7 @@ module TonClient
129
128
  # account: String - # # Account BOC encoded in `base64`.
130
129
  # id: String - # # Account ID encoded in `hex`.
131
130
  def encode_account(payload, &block)
132
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
131
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
133
132
  end
134
133
 
135
134
  # INPUT: ParamsOfDecodeAccountData
@@ -139,7 +138,7 @@ module TonClient
139
138
  # RESPONSE: ResultOfDecodeAccountData
140
139
  # data: Value - # # Decoded data as a JSON structure.
141
140
  def decode_account_data(payload, &block)
142
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
141
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
143
142
  end
144
143
 
145
144
  # INPUT: ParamsOfUpdateInitialData
@@ -151,7 +150,7 @@ module TonClient
151
150
  # RESPONSE: ResultOfUpdateInitialData
152
151
  # data: String - # # Updated data BOC or BOC handle
153
152
  def update_initial_data(payload, &block)
154
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
153
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
155
154
  end
156
155
 
157
156
  # INPUT: ParamsOfEncodeInitialData
@@ -162,7 +161,7 @@ module TonClient
162
161
  # RESPONSE: ResultOfEncodeInitialData
163
162
  # data: String - # # Updated data BOC or BOC handle
164
163
  def encode_initial_data(payload, &block)
165
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
164
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
166
165
  end
167
166
 
168
167
  # INPUT: ParamsOfDecodeInitialData
@@ -173,7 +172,7 @@ module TonClient
173
172
  # initial_data: Value<Optional> - # # List of initial values of contract's public variables. # # Initial data is decoded if `abi` input parameter is provided
174
173
  # initial_pubkey: String - # # Initial account owner's public key
175
174
  def decode_initial_data(payload, &block)
176
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
175
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
177
176
  end
178
177
 
179
178
  # INPUT: ParamsOfDecodeBoc
@@ -183,7 +182,7 @@ module TonClient
183
182
  # RESPONSE: ResultOfDecodeBoc
184
183
  # data: Value - # # Decoded data as a JSON structure.
185
184
  def decode_boc(payload, &block)
186
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
185
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
187
186
  end
188
187
 
189
188
  # INPUT: ParamsOfAbiEncodeBoc
@@ -193,7 +192,7 @@ module TonClient
193
192
  # RESPONSE: ResultOfAbiEncodeBoc
194
193
  # boc: String - # # BOC encoded as base64
195
194
  def encode_boc(payload, &block)
196
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
195
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
197
196
  end
198
197
 
199
198
  # INPUT: ParamsOfCalcFunctionId
@@ -203,7 +202,7 @@ module TonClient
203
202
  # RESPONSE: ResultOfCalcFunctionId
204
203
  # function_id: Number - # # Contract function ID
205
204
  def calc_function_id(payload, &block)
206
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
205
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
207
206
  end
208
207
 
209
208
  end