everscale-client-ruby 1.1.50 → 1.1.60

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c1679c80cf853cae8d1cffde46b65563c2cddaa06c5eb5b05aabe10a3740abf
4
- data.tar.gz: 9e9a8dfcbe28dddebc09981b6a9e13d7c3ed288807d5cd6f22469fe33ba5e13a
3
+ metadata.gz: '018152f8b6c862832f67e76a1e7efc9d9f85e914cf497592748d8eb6243d78f6'
4
+ data.tar.gz: 57cd556a2ee671ce44543cd80fd263a2cf0fd778409a66685f341f9b8383de3e
5
5
  SHA512:
6
- metadata.gz: 2a437e75114c234743d8be5295b15b62e9a3dface3ce0c7214c718b5bec0f3fb12bf01ccfdfbac5728e7d1ef270ba273455f70a40cd360fe4ef10f8fb38708ee
7
- data.tar.gz: 7f31de976109046cb9351e8f5fa7649e6f086e065ac581cab352188bf1f254f0caf370318575dbd239bb4d40cb2ca5612ebec2e562be6287deed62281b1972bc
6
+ metadata.gz: 722a131cb465726d56020747bc858b0a57204849a8216769a92b1e3bc6d6ad6ecb7c146b3b3c5d0aaba4615acabedae297460570fc158eef2e656b3905e19b11
7
+ data.tar.gz: 84bbefd984098f52d7bbd1fe4c90ed85b1b6f3824555618f8eb89d9298c304a5bba5f7911e986a2eb3167e11a15af656c086242eddc09b6aab982cafc89b62c2
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.37.2",
2
+ "version": "1.38.0",
3
3
  "modules": [
4
4
  {
5
5
  "name": "client",
@@ -365,7 +365,7 @@
365
365
  "optional_inner": {
366
366
  "type": "String"
367
367
  },
368
- "summary": "**This field is deprecated, but left for backward-compatibility.** DApp Server public address.",
368
+ "summary": "**This field is deprecated, but left for backward-compatibility.** Evernode endpoint.",
369
369
  "description": null
370
370
  },
371
371
  {
@@ -377,8 +377,8 @@
377
377
  "type": "String"
378
378
  }
379
379
  },
380
- "summary": "List of DApp Server addresses.",
381
- "description": "Any correct URL format can be specified, including IP addresses. This parameter is prevailing over `server_address`.\nCheck the full list of [supported network endpoints](../ton-os-api/networks.md)."
380
+ "summary": "List of Evernode endpoints.",
381
+ "description": "Any correct URL format can be specified, including IP addresses. This parameter is prevailing over `server_address`.\nCheck the full list of [supported network endpoints](https://docs.everos.dev/ever-sdk/reference/ever-os-api/networks)."
382
382
  },
383
383
  {
384
384
  "name": "network_retries_count",
@@ -539,8 +539,8 @@
539
539
  "optional_inner": {
540
540
  "type": "String"
541
541
  },
542
- "summary": "Access key to GraphQL API.",
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."
542
+ "summary": "Access key to GraphQL API (Project secret)",
543
+ "description": null
544
544
  }
545
545
  ],
546
546
  "summary": null,
@@ -11303,6 +11303,13 @@
11303
11303
  "value": "614",
11304
11304
  "summary": null,
11305
11305
  "description": null
11306
+ },
11307
+ {
11308
+ "name": "Unauthorized",
11309
+ "type": "Number",
11310
+ "value": "615",
11311
+ "summary": null,
11312
+ "description": null
11306
11313
  }
11307
11314
  ],
11308
11315
  "summary": null,
@@ -234,7 +234,7 @@ 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 :context, :context_config, :request_id, :requests\n"
237
+ content << "#{TAB}#{TAB}attr_reader :context, :context_config, :request_id, :requests, :monitor\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'
@@ -243,11 +243,13 @@ cd everscale-client-ruby\n
243
243
  content << "#{TAB}#{TAB}MODULE = self.to_s.downcase.gsub(/^(.+::|)(\\w+)$/, '\\2').freeze\n\n"
244
244
  content << "#{TAB}#{TAB}def initialize(context_config: {})\n"
245
245
  content << "#{TAB}#{TAB}#{TAB}@context_config = context_config\n"
246
- content << "#{TAB}#{TAB}#{TAB}@request_id = Concurrent::AtomicFixnum.new(1)\n"
247
- content << "#{TAB}#{TAB}#{TAB}@requests = Concurrent::Hash.new()\n"
246
+ content << "#{TAB}#{TAB}#{TAB}@request_id = RequestId.new\n"
247
+ content << "#{TAB}#{TAB}#{TAB}@requests = Requests.new\n"
248
+ content << "#{TAB}#{TAB}#{TAB}@monitor = Monitor.new\n"
248
249
  content << "#{TAB}#{TAB}#{TAB}config = TonBinding.make_string(context_config.to_json)\n"
249
250
  content << "#{TAB}#{TAB}#{TAB}context_ptr = TonBinding.tc_create_context(config)\n"
250
- content << "#{TAB}#{TAB}#{TAB}@context = TonBinding.read_string_to_hash(context_ptr)['result']\n"
251
+ content << "#{TAB}#{TAB}#{TAB}context_response = TonBinding.read_string_data_ref(context_ptr)\n"
252
+ content << "#{TAB}#{TAB}#{TAB}@context = TonBinding.read_string_to_hash(context_response)['result']\n"
251
253
  content << "#{TAB}#{TAB}#{TAB}ObjectSpace.define_finalizer(self, self.class.finalize(@context))\n"
252
254
  content << "#{TAB}#{TAB}end\n\n"
253
255
  content << "#{TAB}#{TAB}def self.finalize(ctx)\n"
@@ -260,7 +262,7 @@ cd everscale-client-ruby\n
260
262
  modules.each_with_index do |m, i|
261
263
  next if m.name.downcase == 'client'
262
264
  content << "#{TAB}#{TAB}def #{m.name}\n"
263
- content << "#{TAB}#{TAB}#{TAB}_#{m.name} ||= #{m.name.capitalize}.new(context: context, request_id: request_id, requests: requests)\n"
265
+ content << "#{TAB}#{TAB}#{TAB}_#{m.name} ||= #{m.name.capitalize}.new(context: context, request_id: request_id, requests: requests, monitor: monitor)\n"
264
266
  content << "#{TAB}#{TAB}end\n\n"
265
267
  end
266
268
 
@@ -276,12 +278,13 @@ cd everscale-client-ruby\n
276
278
 
277
279
  private def generateModule(mod)
278
280
  content = "module TonClient\n\n#{TAB}class #{mod.name.capitalize}\n#{TAB}#{TAB}include CommonInstanceHelpers\n\n"
279
- content << "#{TAB}#{TAB}attr_reader :context, :request_id, :requests\n"
281
+ content << "#{TAB}#{TAB}attr_reader :context, :request_id, :requests, :monitor\n"
280
282
  content << "#{TAB}#{TAB}MODULE = self.to_s.downcase.gsub(/^(.+::|)(\\w+)$/, '\\2').freeze\n\n"
281
- content << "#{TAB}#{TAB}def initialize(context: nil, request_id: nil, requests: nil)\n"
283
+ content << "#{TAB}#{TAB}def initialize(context: nil, request_id: nil, requests: nil, monitor: nil)\n"
282
284
  content << "#{TAB}#{TAB}#{TAB}@context = context\n"
283
285
  content << "#{TAB}#{TAB}#{TAB}@request_id = request_id\n"
284
286
  content << "#{TAB}#{TAB}#{TAB}@requests = requests\n"
287
+ content << "#{TAB}#{TAB}#{TAB}@monitor = monitor\n"
285
288
  content << "#{TAB}#{TAB}end\n\n"
286
289
 
287
290
  mod.functions.each do |func|
@@ -296,14 +299,28 @@ cd everscale-client-ruby\n
296
299
 
297
300
  private def gen_function(function, types)
298
301
  content = getFunctionComment(function, types)
302
+ content << "#{TAB}#{TAB}# Async\n"
299
303
  content << "#{TAB}#{TAB}def #{function.name}"
300
304
  if function.arguments.empty?
301
305
  content << "(&block)\n"
302
- content << "#{TAB}#{TAB}#{TAB}TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)\n"
306
+ payload = "{}"
303
307
  else
304
308
  content << "(payload, &block)\n"
305
- content << "#{TAB}#{TAB}#{TAB}TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)\n"
309
+ payload = "payload"
306
310
  end
311
+ content << "#{TAB}#{TAB}#{TAB}TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: #{payload}, &block)\n"
312
+ content << "#{TAB}#{TAB}end\n\n"
313
+
314
+ content << "#{TAB}#{TAB}# Sync\n"
315
+ content << "#{TAB}#{TAB}def #{function.name}_sync"
316
+ if function.arguments.empty?
317
+ content << "()\n"
318
+ payload = "{}"
319
+ else
320
+ content << "(payload)\n"
321
+ payload = "payload"
322
+ end
323
+ content << "#{TAB}#{TAB}#{TAB}TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: #{payload})\n"
307
324
  content << "#{TAB}#{TAB}end\n\n"
308
325
 
309
326
  content
@@ -1,5 +1,3 @@
1
- require 'byebug'
2
-
3
1
  module TonClient
4
2
  module TonBinding
5
3
  class Response
@@ -16,10 +14,11 @@ module TonClient
16
14
  @request_id = request_id
17
15
  @response_type = response_type
18
16
  @error = string_data || "Client deallocated"
17
+ p "ERROR: #{@error}"
19
18
  return self
20
19
  end
21
-
22
- response_hash = TonBinding.read_string_to_hash(string_data)
20
+
21
+ response_hash = TonBinding.read_string_to_hash(TonBinding.read_string_data(string_data))
23
22
  @finished = finished
24
23
  @request_id = request_id
25
24
  @response_type = response_type
@@ -49,15 +48,15 @@ module TonClient
49
48
 
50
49
  module TonBinding
51
50
  extend FFI::Library
52
- # ffi_lib FFI::Library::LIBC
53
- # ffi_lib 'ruby'
51
+ ffi_lib FFI::Library::LIBC
52
+ ffi_lib 'ruby'
54
53
 
55
54
  # memory allocators
56
- # attach_function :malloc, [:size_t], :pointer
55
+ attach_function :malloc, [:size_t], :pointer
57
56
  # attach_function :calloc, [:size_t], :pointer
58
57
  # attach_function :valloc, [:size_t], :pointer
59
58
  # attach_function :realloc, [:pointer, :size_t], :pointer
60
- # attach_function :free, [:pointer], :void
59
+ attach_function :free, [:pointer], :void
61
60
 
62
61
  # # memory movers
63
62
  # attach_function :memcpy, [:pointer, :pointer, :size_t], :pointer
@@ -66,7 +65,7 @@ module TonClient
66
65
  def self.setup_bindings
67
66
 
68
67
  # tc_string_handle_t* tc_create_context(tc_string_data_t config);
69
- # attach_function :tc_create_context, [TcStringDataT.by_value], TcStringHandleT.by_ref
68
+ # attach_function :tc_create_context, [TcStringDataT.by_value], TcStringDataT.by_ref
70
69
  attach_function :tc_create_context, [TcStringDataT.by_value], :pointer
71
70
 
72
71
  # fn tc_destroy_context(context: InteropContext)
@@ -76,7 +75,7 @@ module TonClient
76
75
  # uint32_t context,
77
76
  # tc_string_data_t function_name,
78
77
  # tc_string_data_t function_params_json);
79
- # attach_function :tc_request_sync, [:uint32, TcStringDataT.by_value, TcStringDataT.by_value], TcStringHandleT.by_ref
78
+ # attach_function :tc_request_sync, [:uint32, TcStringDataT.by_value, TcStringDataT.by_value], TcStringDataT.by_ref
80
79
  attach_function :tc_request_sync, [:uint32, TcStringDataT.by_value, TcStringDataT.by_value], :pointer
81
80
 
82
81
  # enum tc_response_types_t {
@@ -101,52 +100,50 @@ module TonClient
101
100
  attach_function :tc_request, [:uint32, TcStringDataT.by_value, TcStringDataT.by_value, :uint32, :tc_response_handler_t], :void
102
101
 
103
102
  # tc_string_data_t tc_read_string(const tc_string_handle_t* handle);
104
- # attach_function :tc_read_string, [TcStringHandleT.by_ref], TcStringDataT.by_value
103
+ # attach_function :tc_read_string, [TcStringDataT.by_ref], TcStringDataT.by_value
105
104
  attach_function :tc_read_string, [:pointer], TcStringDataT.by_value
106
105
 
107
106
  # void tc_destroy_string(const tc_string_handle_t* handle)
108
- # attach_function :tc_destroy_string, [TcStringHandleT.by_ref], :void
107
+ # attach_function :tc_destroy_string, [TcStringDataT.by_ref], :void
109
108
  attach_function :tc_destroy_string, [:pointer], :void
110
109
  end
111
110
 
112
111
  def self.make_string(string)
113
- # p 1
112
+ string = string.encode("utf-8").freeze
114
113
  result = TonBinding::TcStringDataT.new
115
- bytes_count = string.unpack("C*").size
116
- ptr1 = FFI::MemoryPointer.new(:char, bytes_count)
117
- ptr1.put_bytes(0, string, 0, bytes_count)
118
- # ptr1.autorelease = false
119
- # p ptr1.autorelease?
120
- result[:content] = ptr1
121
- # result[:content] = FFI::MemoryPointer.from_string(string)
122
- # result[:len] = string.bytesize
123
- result[:len] = ptr1.size
124
- # p 2
114
+ result[:content] = FFI::MemoryPointer.from_string(string)
115
+ result[:len] = string.bytesize
125
116
  result
126
117
  end
127
118
 
128
- def self.read_string(tc_string_handle)
129
- is_ref = tc_string_handle.class == FFI::Pointer
130
- if is_ref
131
- string = tc_read_string(tc_string_handle)
119
+ def self.read_string_data_ref(tc_string_handle_ref)
120
+ string = tc_read_string(tc_string_handle_ref)
121
+
122
+ if string[:len] > 0
123
+ result = string[:content].read_string(string[:len]).freeze
124
+ if tc_string_handle_ref
125
+ tc_destroy_string(tc_string_handle_ref)
126
+ else
127
+ p "NOOOOOOOOOOOO"
128
+ end
129
+ # free(tc_string_handle_ref)
130
+ result
132
131
  else
133
- string = tc_string_handle
132
+ nil
134
133
  end
134
+ end
135
135
 
136
- if string[:content].address > 1
137
- result = string[:content].read_string(string[:len])
138
- if is_ref
139
- tc_destroy_string(tc_string_handle)
140
- # free(tc_string_handle)
141
- end
136
+ def self.read_string_data(tc_string_data)
137
+ if tc_string_data[:len] > 0
138
+ result = tc_string_data[:content].read_string(tc_string_data[:len]).freeze
139
+ # free(tc_string_data)
142
140
  result
143
141
  else
144
142
  nil
145
143
  end
146
144
  end
147
145
 
148
- def self.read_string_to_hash(tc_string_handle_t_ref)
149
- json_string = read_string(tc_string_handle_t_ref)
146
+ def self.read_string_to_hash(json_string)
150
147
  JSON.parse(json_string, {max_nesting: false}) if json_string
151
148
  end
152
149
 
@@ -158,37 +155,49 @@ module TonClient
158
155
  payload_string = make_string(payload.to_json)
159
156
 
160
157
  sdk_json_response = tc_request_sync(context, method_name_string, payload_string)
161
- response = read_string_to_hash(sdk_json_response)
162
-
163
- return response['result'] if response['result']
164
- return response['error'] if response['error']
158
+ response = read_string_to_hash(read_string_data_ref(sdk_json_response))
159
+
160
+ response
165
161
  end
166
162
 
167
163
  # block = { |response| }
168
- def self.requestLibrary(context: nil, request_id: nil, requests: nil, sm: nil, method_name: '', payload: {}, &block)
169
- raise 'context not found' unless context
170
- raise 'method_name is empty' if method_name.empty?
171
- # raise "context: #{context}. request_id not is nil. Client dealloc." unless request_id
172
- unless request_id
173
- # p "context: #{context}. request_id is nil. Client deallocated."
174
- block.call(Response.new(request_id, "Client deallocated", -1, true)) if block
175
- return
176
- end
177
- method_name_string = make_string(method_name)
178
- payload_string = make_string(payload.to_json)
179
-
180
- request_id = request_id.increment
181
- requests[request_id] = block
182
-
183
- tc_request(context, method_name_string, payload_string, request_id) do |request_id, string_data, response_type, finished|
184
- begin
185
- request = requests[request_id]
186
- if request
187
- request.call(Response.new(request_id, string_data, response_type, finished))
188
- requests.delete(request_id) if finished
164
+ def self.requestLibrary(context: nil,
165
+ request_id: nil,
166
+ requests: nil,
167
+ monitor: nil,
168
+ method_name: '',
169
+ payload: {},
170
+ &block
171
+ )
172
+ monitor&.synchronize do
173
+ raise 'context not found' unless context
174
+ raise 'method_name is empty' if method_name.empty?
175
+ # raise "context: #{context}. request_id not is nil. Client dealloc." unless request_id
176
+ unless request_id
177
+ # p "context: #{context}. request_id is nil. Client deallocated."
178
+ block.call(Response.new(request_id, "Client deallocated", -1, true)) if block
179
+ return
180
+ end
181
+ method_name_string = make_string(method_name)
182
+ payload_string = make_string(payload.to_json)
183
+
184
+ request_id = request_id.increment
185
+ requests[request_id] = block
186
+ # p "start #{request_id}"
187
+ tc_request(context, method_name_string, payload_string, request_id) do |request_id, string_data, response_type, finished|
188
+ # p "tc_request #{request_id}"
189
+ # p "Thread.current #{Thread.current}"
190
+ begin
191
+ monitor.synchronize do
192
+ request = requests[request_id]
193
+ if request
194
+ request.call(Response.new(request_id, string_data, response_type, finished))
195
+ requests.delete(request_id) if finished
196
+ end
197
+ end
198
+ rescue => ex
199
+ block.call(Response.new(request_id, ex.message, -1, true)) if block
189
200
  end
190
- rescue => ex
191
- block.call(Response.new(request_id, ex.message, -1, true)) if block
192
201
  end
193
202
  end
194
203
  rescue => ex
@@ -8,6 +8,19 @@ module TonClient
8
8
  class TcStringDataT < FFI::Struct
9
9
  layout :content, :pointer,
10
10
  :len, :uint32
11
+
12
+ # def initialize(*args)
13
+ # super
14
+ # ObjectSpace.define_finalizer(self, self.class.finalize(@content))
15
+ # end
16
+ #
17
+ # def self.finalize(ctx)
18
+ # Proc.new do
19
+ # if ctx != nil
20
+ # TonBinding.free(ctx)
21
+ # end
22
+ # end
23
+ # end
11
24
  end
12
25
  end
13
26
  end
@@ -3,13 +3,14 @@ module TonClient
3
3
  class Abi
4
4
  include CommonInstanceHelpers
5
5
 
6
- attr_reader :context, :request_id, :requests
6
+ attr_reader :context, :request_id, :requests, :monitor
7
7
  MODULE = self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
8
8
 
9
- def initialize(context: nil, request_id: nil, requests: nil)
9
+ def initialize(context: nil, request_id: nil, requests: nil, monitor: nil)
10
10
  @context = context
11
11
  @request_id = request_id
12
12
  @requests = requests
13
+ @monitor = monitor
13
14
  end
14
15
 
15
16
  # INPUT: ParamsOfEncodeMessageBody
@@ -27,8 +28,14 @@ module TonClient
27
28
  # body: String - # # Message body BOC encoded with `base64`.
28
29
  # data_to_sign: String<Optional> - # # Optional data to sign. # # Encoded with `base64`.
29
30
  # # 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`.
31
+ # Async
30
32
  def encode_message_body(payload, &block)
31
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
33
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
34
+ end
35
+
36
+ # Sync
37
+ def encode_message_body_sync(payload)
38
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
32
39
  end
33
40
 
34
41
  # INPUT: ParamsOfAttachSignatureToMessageBody
@@ -38,8 +45,14 @@ module TonClient
38
45
  # signature: String - # # Signature. # # Must be encoded with `hex`.
39
46
  # RESPONSE: ResultOfAttachSignatureToMessageBody
40
47
  # body: String -
48
+ # Async
41
49
  def attach_signature_to_message_body(payload, &block)
42
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
50
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
51
+ end
52
+
53
+ # Sync
54
+ def attach_signature_to_message_body_sync(payload)
55
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
43
56
  end
44
57
 
45
58
  # INPUT: ParamsOfEncodeMessage
@@ -59,8 +72,14 @@ module TonClient
59
72
  # data_to_sign: String<Optional> - # # Optional data to be signed encoded in `base64`. # # Returned in case of `Signer::External`. Can be used for externalmessage signing. Is this case you need to use this data to create signature andthen produce signed message using `abi.attach_signature`.
60
73
  # address: String - # # Destination address.
61
74
  # message_id: String - # # Message id.
75
+ # Async
62
76
  def encode_message(payload, &block)
63
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
77
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
78
+ end
79
+
80
+ # Sync
81
+ def encode_message_sync(payload)
82
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
64
83
  end
65
84
 
66
85
  # INPUT: ParamsOfEncodeInternalMessage
@@ -77,8 +96,14 @@ module TonClient
77
96
  # message: String - # # Message BOC encoded with `base64`.
78
97
  # address: String - # # Destination address.
79
98
  # message_id: String - # # Message id.
99
+ # Async
80
100
  def encode_internal_message(payload, &block)
81
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
101
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
102
+ end
103
+
104
+ # Sync
105
+ def encode_internal_message_sync(payload)
106
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
82
107
  end
83
108
 
84
109
  # INPUT: ParamsOfAttachSignature
@@ -89,8 +114,14 @@ module TonClient
89
114
  # RESPONSE: ResultOfAttachSignature
90
115
  # message: String - # # Signed message BOC
91
116
  # message_id: String - # # Message ID
117
+ # Async
92
118
  def attach_signature(payload, &block)
93
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
119
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
120
+ end
121
+
122
+ # Sync
123
+ def attach_signature_sync(payload)
124
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
94
125
  end
95
126
 
96
127
  # INPUT: ParamsOfDecodeMessage
@@ -102,8 +133,14 @@ module TonClient
102
133
  # name: String - # # Function or event name.
103
134
  # value: Value<Optional> - # # Parameters or result value.
104
135
  # header: FunctionHeader<Optional> - # # Function header.
136
+ # Async
105
137
  def decode_message(payload, &block)
106
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
138
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
139
+ end
140
+
141
+ # Sync
142
+ def decode_message_sync(payload)
143
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
107
144
  end
108
145
 
109
146
  # INPUT: ParamsOfDecodeMessageBody
@@ -116,8 +153,14 @@ module TonClient
116
153
  # name: String - # # Function or event name.
117
154
  # value: Value<Optional> - # # Parameters or result value.
118
155
  # header: FunctionHeader<Optional> - # # Function header.
156
+ # Async
119
157
  def decode_message_body(payload, &block)
120
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
158
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
159
+ end
160
+
161
+ # Sync
162
+ def decode_message_body_sync(payload)
163
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
121
164
  end
122
165
 
123
166
  # INPUT: ParamsOfEncodeAccount
@@ -129,8 +172,14 @@ module TonClient
129
172
  # RESPONSE: ResultOfEncodeAccount
130
173
  # account: String - # # Account BOC encoded in `base64`.
131
174
  # id: String - # # Account ID encoded in `hex`.
175
+ # Async
132
176
  def encode_account(payload, &block)
133
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
177
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
178
+ end
179
+
180
+ # Sync
181
+ def encode_account_sync(payload)
182
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
134
183
  end
135
184
 
136
185
  # INPUT: ParamsOfDecodeAccountData
@@ -139,8 +188,14 @@ module TonClient
139
188
  # allow_partial: Boolean<Optional> - # # Flag allowing partial BOC decoding when ABI doesn't describe the full body BOC. Controls decoder behaviour when after decoding all described in ABI params there are some data left in BOC: `true` - return decoded values `false` - return error of incomplete BOC deserialization (default)
140
189
  # RESPONSE: ResultOfDecodeAccountData
141
190
  # data: Value - # # Decoded data as a JSON structure.
191
+ # Async
142
192
  def decode_account_data(payload, &block)
143
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
193
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
194
+ end
195
+
196
+ # Sync
197
+ def decode_account_data_sync(payload)
198
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
144
199
  end
145
200
 
146
201
  # INPUT: ParamsOfUpdateInitialData
@@ -151,8 +206,14 @@ module TonClient
151
206
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
152
207
  # RESPONSE: ResultOfUpdateInitialData
153
208
  # data: String - # # Updated data BOC or BOC handle
209
+ # Async
154
210
  def update_initial_data(payload, &block)
155
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
211
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
212
+ end
213
+
214
+ # Sync
215
+ def update_initial_data_sync(payload)
216
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
156
217
  end
157
218
 
158
219
  # INPUT: ParamsOfEncodeInitialData
@@ -162,8 +223,14 @@ module TonClient
162
223
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
163
224
  # RESPONSE: ResultOfEncodeInitialData
164
225
  # data: String - # # Updated data BOC or BOC handle
226
+ # Async
165
227
  def encode_initial_data(payload, &block)
166
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
228
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
229
+ end
230
+
231
+ # Sync
232
+ def encode_initial_data_sync(payload)
233
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
167
234
  end
168
235
 
169
236
  # INPUT: ParamsOfDecodeInitialData
@@ -173,8 +240,14 @@ module TonClient
173
240
  # RESPONSE: ResultOfDecodeInitialData
174
241
  # initial_data: Value<Optional> - # # List of initial values of contract's public variables. # # Initial data is decoded if `abi` input parameter is provided
175
242
  # initial_pubkey: String - # # Initial account owner's public key
243
+ # Async
176
244
  def decode_initial_data(payload, &block)
177
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
245
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
246
+ end
247
+
248
+ # Sync
249
+ def decode_initial_data_sync(payload)
250
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
178
251
  end
179
252
 
180
253
  # INPUT: ParamsOfDecodeBoc
@@ -183,8 +256,14 @@ module TonClient
183
256
  # allow_partial: Boolean -
184
257
  # RESPONSE: ResultOfDecodeBoc
185
258
  # data: Value - # # Decoded data as a JSON structure.
259
+ # Async
186
260
  def decode_boc(payload, &block)
187
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
261
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
262
+ end
263
+
264
+ # Sync
265
+ def decode_boc_sync(payload)
266
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
188
267
  end
189
268
 
190
269
  # INPUT: ParamsOfAbiEncodeBoc
@@ -193,8 +272,14 @@ module TonClient
193
272
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. # # The BOC itself returned if no cache type provided
194
273
  # RESPONSE: ResultOfAbiEncodeBoc
195
274
  # boc: String - # # BOC encoded as base64
275
+ # Async
196
276
  def encode_boc(payload, &block)
197
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
277
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
278
+ end
279
+
280
+ # Sync
281
+ def encode_boc_sync(payload)
282
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
198
283
  end
199
284
 
200
285
  # INPUT: ParamsOfCalcFunctionId
@@ -203,8 +288,14 @@ module TonClient
203
288
  # output: Boolean<Optional> - # # If set to `true` output function ID will be returned which is used in contract response. Default is `false`
204
289
  # RESPONSE: ResultOfCalcFunctionId
205
290
  # function_id: Number - # # Contract function ID
291
+ # Async
206
292
  def calc_function_id(payload, &block)
207
- TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
293
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
294
+ end
295
+
296
+ # Sync
297
+ def calc_function_id_sync(payload)
298
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
208
299
  end
209
300
 
210
301
  end