everscale-client-ruby 1.1.44 → 1.1.49
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 +4 -4
- data/lib/code_generator/code_generator.rb +24 -12
- data/lib/everscale-client-ruby/Binding/binding.rb +79 -82
- data/lib/everscale-client-ruby/Binding/struct.rb +0 -8
- data/lib/everscale-client-ruby/Client/Abi.rb +19 -18
- data/lib/everscale-client-ruby/Client/Boc.rb +23 -22
- data/lib/everscale-client-ruby/Client/Client.rb +29 -20
- data/lib/everscale-client-ruby/Client/Crypto.rb +55 -54
- data/lib/everscale-client-ruby/Client/Debot.rb +10 -9
- data/lib/everscale-client-ruby/Client/Net.rb +26 -25
- data/lib/everscale-client-ruby/Client/Processing.rb +7 -6
- data/lib/everscale-client-ruby/Client/Proofs.rb +7 -6
- data/lib/everscale-client-ruby/Client/Tvm.rb +7 -6
- data/lib/everscale-client-ruby/Client/Utils.rb +9 -8
- data/lib/everscale-client-ruby/version.rb +1 -1
- data/lib/everscale-client-ruby.rb +2 -2
- metadata +7 -8
- data/lib/everscale-client-ruby/Client/Context.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd5555c9c9abe1ebd8114686f13a1e9899c1c93c063df2d5cd6aa3eb187e760a
|
4
|
+
data.tar.gz: 479f9a3ddabc09d16e5b1087f318bab9ac397ef4820c8dd99a95fa3a67e10e4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b584f384a498c2fb6656c7ddb43c5538f878ce1c14f1cafd95e457d60cf748c2f21114efc6f65d19eef438b8e46fe204c5cf33ca8c7882dcf25481f8a6e13c9
|
7
|
+
data.tar.gz: c2fcb5bb3e0b7a4b33e1cc4cf90887a521af7d0ba0db58fe39d6af958a79564f999cad7a4e3f03886e6e92b796fc23c9028a8bdbc348256e78ce507bb9a0177b
|
@@ -234,22 +234,33 @@ 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 :
|
237
|
+
content << "#{TAB}#{TAB}attr_reader :context, :context_config, :request_id, :requests\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(
|
245
|
-
content << "#{TAB}#{TAB}#{TAB}@
|
246
|
-
content << "#{TAB}#{TAB}#{TAB}@
|
247
|
-
content << "#{TAB}#{TAB}
|
248
|
-
content << "#{TAB}#{TAB}#{TAB}
|
244
|
+
content << "#{TAB}#{TAB}def initialize(context_config: {})\n"
|
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"
|
248
|
+
content << "#{TAB}#{TAB}#{TAB}config = TonBinding.make_string(context_config.to_json)\n"
|
249
|
+
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}ObjectSpace.define_finalizer(self, self.class.finalize(@context))\n"
|
252
|
+
content << "#{TAB}#{TAB}end\n\n"
|
253
|
+
content << "#{TAB}#{TAB}def self.finalize(ctx)\n"
|
254
|
+
content << "#{TAB}#{TAB}#{TAB}Proc.new do\n"
|
255
|
+
content << "#{TAB}#{TAB}#{TAB}#{TAB}if (ctx != nil) && (ctx > 0)\n"
|
256
|
+
content << "#{TAB}#{TAB}#{TAB}#{TAB}#{TAB}TonBinding.tc_destroy_context(ctx)\n"
|
257
|
+
content << "#{TAB}#{TAB}#{TAB}#{TAB}end\n"
|
258
|
+
content << "#{TAB}#{TAB}#{TAB}end\n"
|
259
|
+
content << "#{TAB}#{TAB}end\n\n"
|
249
260
|
modules.each_with_index do |m, i|
|
250
261
|
next if m.name.downcase == 'client'
|
251
262
|
content << "#{TAB}#{TAB}def #{m.name}\n"
|
252
|
-
content << "#{TAB}#{TAB}#{TAB}_#{m.name} ||= #{m.name.capitalize}.new(context: context)\n"
|
263
|
+
content << "#{TAB}#{TAB}#{TAB}_#{m.name} ||= #{m.name.capitalize}.new(context: context, request_id: request_id, requests: requests)\n"
|
253
264
|
content << "#{TAB}#{TAB}end\n\n"
|
254
265
|
end
|
255
266
|
|
@@ -265,11 +276,12 @@ cd everscale-client-ruby\n
|
|
265
276
|
|
266
277
|
private def generateModule(mod)
|
267
278
|
content = "module TonClient\n\n#{TAB}class #{mod.name.capitalize}\n#{TAB}#{TAB}include CommonInstanceHelpers\n\n"
|
268
|
-
content << "#{TAB}#{TAB}attr_reader :
|
279
|
+
content << "#{TAB}#{TAB}attr_reader :context, :request_id, :requests\n"
|
269
280
|
content << "#{TAB}#{TAB}MODULE = self.to_s.downcase.gsub(/^(.+::|)(\\w+)$/, '\\2').freeze\n\n"
|
270
|
-
content << "#{TAB}#{TAB}def initialize(context:
|
281
|
+
content << "#{TAB}#{TAB}def initialize(context: nil, request_id: nil, requests: nil)\n"
|
271
282
|
content << "#{TAB}#{TAB}#{TAB}@context = context\n"
|
272
|
-
content << "#{TAB}#{TAB}#{TAB}@
|
283
|
+
content << "#{TAB}#{TAB}#{TAB}@request_id = request_id\n"
|
284
|
+
content << "#{TAB}#{TAB}#{TAB}@requests = requests\n"
|
273
285
|
content << "#{TAB}#{TAB}end\n\n"
|
274
286
|
|
275
287
|
mod.functions.each do |func|
|
@@ -287,10 +299,10 @@ cd everscale-client-ruby\n
|
|
287
299
|
content << "#{TAB}#{TAB}def #{function.name}"
|
288
300
|
if function.arguments.empty?
|
289
301
|
content << "(&block)\n"
|
290
|
-
content << "#{TAB}#{TAB}#{TAB}
|
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"
|
291
303
|
else
|
292
304
|
content << "(payload, &block)\n"
|
293
|
-
content << "#{TAB}#{TAB}#{TAB}
|
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"
|
294
306
|
end
|
295
307
|
content << "#{TAB}#{TAB}end\n\n"
|
296
308
|
|
@@ -1,52 +1,45 @@
|
|
1
|
+
require 'byebug'
|
2
|
+
|
1
3
|
module TonClient
|
2
4
|
module TonBinding
|
3
|
-
@@request_id = 0
|
4
|
-
@@requests = {}
|
5
|
-
|
6
5
|
class Response
|
7
|
-
|
8
|
-
attr_accessor :result, :error, :custom_response, :finished, :request_id, :current_response
|
6
|
+
attr_accessor :result, :error, :custom_response, :finished, :request_id, :response_type
|
9
7
|
|
10
|
-
def initialize(
|
11
|
-
|
8
|
+
def initialize(request_id, string_data, response_type, finished)
|
9
|
+
update(request_id, string_data, response_type, finished)
|
12
10
|
end
|
13
11
|
|
12
|
+
private
|
14
13
|
def update(request_id, string_data, response_type, finished)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
if response_type == -1
|
15
|
+
@finished = true
|
16
|
+
@request_id = request_id
|
17
|
+
@response_type = response_type
|
18
|
+
@error = string_data || "Client deallocated"
|
19
|
+
return self
|
20
|
+
end
|
21
|
+
|
22
|
+
response_hash = TonBinding.read_string_to_hash(string_data)
|
23
|
+
@finished = finished
|
24
|
+
@request_id = request_id
|
25
|
+
@response_type = response_type
|
26
|
+
|
19
27
|
case response_type
|
20
28
|
when 0
|
21
29
|
# result
|
22
|
-
|
30
|
+
@result = response_hash
|
23
31
|
when 1
|
24
32
|
# error
|
25
|
-
|
33
|
+
@error = response_hash
|
26
34
|
else
|
27
|
-
# another
|
28
|
-
if response_type >= 100
|
29
|
-
|
30
|
-
end
|
35
|
+
# # another
|
36
|
+
# if response_type >= 100
|
37
|
+
@custom_response = response_hash
|
38
|
+
# end
|
31
39
|
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.generate_request_id
|
36
|
-
@@request_id = 0 if @@request_id == 4294967295
|
37
|
-
@@request_id += 1
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.get_request(id)
|
41
|
-
@@requests[id]
|
42
|
-
end
|
43
|
-
|
44
|
-
def self.delete_request(id)
|
45
|
-
@@requests[id] = nil
|
46
|
-
end
|
47
40
|
|
48
|
-
|
49
|
-
|
41
|
+
self
|
42
|
+
end
|
50
43
|
end
|
51
44
|
end
|
52
45
|
end
|
@@ -56,18 +49,19 @@ module TonClient
|
|
56
49
|
|
57
50
|
module TonBinding
|
58
51
|
extend FFI::Library
|
59
|
-
ffi_lib FFI::Library::LIBC
|
52
|
+
# ffi_lib FFI::Library::LIBC
|
53
|
+
# ffi_lib 'ruby'
|
60
54
|
|
61
55
|
# 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
|
56
|
+
# attach_function :malloc, [:size_t], :pointer
|
57
|
+
# attach_function :calloc, [:size_t], :pointer
|
58
|
+
# attach_function :valloc, [:size_t], :pointer
|
59
|
+
# attach_function :realloc, [:pointer, :size_t], :pointer
|
60
|
+
# attach_function :free, [:pointer], :void
|
67
61
|
|
68
|
-
# memory movers
|
69
|
-
attach_function :memcpy, [:pointer, :pointer, :size_t], :pointer
|
70
|
-
attach_function :bcopy, [:pointer, :pointer, :size_t], :void
|
62
|
+
# # memory movers
|
63
|
+
# attach_function :memcpy, [:pointer, :pointer, :size_t], :pointer
|
64
|
+
# attach_function :bcopy, [:pointer, :pointer, :size_t], :void
|
71
65
|
|
72
66
|
def self.setup_bindings
|
73
67
|
|
@@ -116,28 +110,21 @@ module TonClient
|
|
116
110
|
end
|
117
111
|
|
118
112
|
def self.make_string(string)
|
113
|
+
# p 1
|
119
114
|
result = TonBinding::TcStringDataT.new
|
120
|
-
|
121
|
-
|
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
|
122
125
|
result
|
123
126
|
end
|
124
127
|
|
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
128
|
def self.read_string(tc_string_handle)
|
142
129
|
is_ref = tc_string_handle.class == FFI::Pointer
|
143
130
|
if is_ref
|
@@ -147,11 +134,15 @@ module TonClient
|
|
147
134
|
end
|
148
135
|
|
149
136
|
if string[:content].address > 1
|
150
|
-
|
151
|
-
|
152
|
-
|
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
|
142
|
+
result
|
143
|
+
else
|
144
|
+
nil
|
153
145
|
end
|
154
|
-
nil
|
155
146
|
end
|
156
147
|
|
157
148
|
def self.read_string_to_hash(tc_string_handle_t_ref)
|
@@ -173,29 +164,35 @@ module TonClient
|
|
173
164
|
return response['error'] if response['error']
|
174
165
|
end
|
175
166
|
|
176
|
-
|
167
|
+
# block = { |response| }
|
168
|
+
def self.requestLibrary(context: nil, request_id: nil, requests: nil, sm: nil, method_name: '', payload: {}, &block)
|
177
169
|
raise 'context not found' unless context
|
178
170
|
raise 'method_name is empty' if method_name.empty?
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
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
|
184
176
|
end
|
185
|
-
|
177
|
+
method_name_string = make_string(method_name)
|
178
|
+
payload_string = make_string(payload.to_json)
|
186
179
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
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
|
189
|
+
end
|
190
|
+
rescue => ex
|
191
|
+
block.call(Response.new(request_id, ex.message, -1, true)) if block
|
197
192
|
end
|
198
193
|
end
|
194
|
+
rescue => ex
|
195
|
+
block.call(Response.new(request_id, ex.message, -1, true)) if block
|
199
196
|
end
|
200
197
|
|
201
198
|
end
|
@@ -3,12 +3,13 @@ module TonClient
|
|
3
3
|
class Abi
|
4
4
|
include CommonInstanceHelpers
|
5
5
|
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :context, :request_id, :requests
|
7
7
|
MODULE = self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
|
8
8
|
|
9
|
-
def initialize(context:
|
9
|
+
def initialize(context: nil, request_id: nil, requests: nil)
|
10
10
|
@context = context
|
11
|
-
@
|
11
|
+
@request_id = request_id
|
12
|
+
@requests = requests
|
12
13
|
end
|
13
14
|
|
14
15
|
# INPUT: ParamsOfEncodeMessageBody
|
@@ -27,7 +28,7 @@ module TonClient
|
|
27
28
|
# data_to_sign: String<Optional> - # # Optional data to sign. # # Encoded with `base64`.
|
28
29
|
# # 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
30
|
def encode_message_body(payload, &block)
|
30
|
-
|
31
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
31
32
|
end
|
32
33
|
|
33
34
|
# INPUT: ParamsOfAttachSignatureToMessageBody
|
@@ -38,7 +39,7 @@ module TonClient
|
|
38
39
|
# RESPONSE: ResultOfAttachSignatureToMessageBody
|
39
40
|
# body: String -
|
40
41
|
def attach_signature_to_message_body(payload, &block)
|
41
|
-
|
42
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
42
43
|
end
|
43
44
|
|
44
45
|
# INPUT: ParamsOfEncodeMessage
|
@@ -59,7 +60,7 @@ module TonClient
|
|
59
60
|
# address: String - # # Destination address.
|
60
61
|
# message_id: String - # # Message id.
|
61
62
|
def encode_message(payload, &block)
|
62
|
-
|
63
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
63
64
|
end
|
64
65
|
|
65
66
|
# INPUT: ParamsOfEncodeInternalMessage
|
@@ -77,7 +78,7 @@ module TonClient
|
|
77
78
|
# address: String - # # Destination address.
|
78
79
|
# message_id: String - # # Message id.
|
79
80
|
def encode_internal_message(payload, &block)
|
80
|
-
|
81
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
81
82
|
end
|
82
83
|
|
83
84
|
# INPUT: ParamsOfAttachSignature
|
@@ -89,7 +90,7 @@ module TonClient
|
|
89
90
|
# message: String - # # Signed message BOC
|
90
91
|
# message_id: String - # # Message ID
|
91
92
|
def attach_signature(payload, &block)
|
92
|
-
|
93
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
93
94
|
end
|
94
95
|
|
95
96
|
# INPUT: ParamsOfDecodeMessage
|
@@ -102,7 +103,7 @@ module TonClient
|
|
102
103
|
# value: Value<Optional> - # # Parameters or result value.
|
103
104
|
# header: FunctionHeader<Optional> - # # Function header.
|
104
105
|
def decode_message(payload, &block)
|
105
|
-
|
106
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
106
107
|
end
|
107
108
|
|
108
109
|
# INPUT: ParamsOfDecodeMessageBody
|
@@ -116,7 +117,7 @@ module TonClient
|
|
116
117
|
# value: Value<Optional> - # # Parameters or result value.
|
117
118
|
# header: FunctionHeader<Optional> - # # Function header.
|
118
119
|
def decode_message_body(payload, &block)
|
119
|
-
|
120
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
120
121
|
end
|
121
122
|
|
122
123
|
# INPUT: ParamsOfEncodeAccount
|
@@ -129,7 +130,7 @@ module TonClient
|
|
129
130
|
# account: String - # # Account BOC encoded in `base64`.
|
130
131
|
# id: String - # # Account ID encoded in `hex`.
|
131
132
|
def encode_account(payload, &block)
|
132
|
-
|
133
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
133
134
|
end
|
134
135
|
|
135
136
|
# INPUT: ParamsOfDecodeAccountData
|
@@ -139,7 +140,7 @@ module TonClient
|
|
139
140
|
# RESPONSE: ResultOfDecodeAccountData
|
140
141
|
# data: Value - # # Decoded data as a JSON structure.
|
141
142
|
def decode_account_data(payload, &block)
|
142
|
-
|
143
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
143
144
|
end
|
144
145
|
|
145
146
|
# INPUT: ParamsOfUpdateInitialData
|
@@ -151,7 +152,7 @@ module TonClient
|
|
151
152
|
# RESPONSE: ResultOfUpdateInitialData
|
152
153
|
# data: String - # # Updated data BOC or BOC handle
|
153
154
|
def update_initial_data(payload, &block)
|
154
|
-
|
155
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
155
156
|
end
|
156
157
|
|
157
158
|
# INPUT: ParamsOfEncodeInitialData
|
@@ -162,7 +163,7 @@ module TonClient
|
|
162
163
|
# RESPONSE: ResultOfEncodeInitialData
|
163
164
|
# data: String - # # Updated data BOC or BOC handle
|
164
165
|
def encode_initial_data(payload, &block)
|
165
|
-
|
166
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
166
167
|
end
|
167
168
|
|
168
169
|
# INPUT: ParamsOfDecodeInitialData
|
@@ -173,7 +174,7 @@ module TonClient
|
|
173
174
|
# initial_data: Value<Optional> - # # List of initial values of contract's public variables. # # Initial data is decoded if `abi` input parameter is provided
|
174
175
|
# initial_pubkey: String - # # Initial account owner's public key
|
175
176
|
def decode_initial_data(payload, &block)
|
176
|
-
|
177
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
177
178
|
end
|
178
179
|
|
179
180
|
# INPUT: ParamsOfDecodeBoc
|
@@ -183,7 +184,7 @@ module TonClient
|
|
183
184
|
# RESPONSE: ResultOfDecodeBoc
|
184
185
|
# data: Value - # # Decoded data as a JSON structure.
|
185
186
|
def decode_boc(payload, &block)
|
186
|
-
|
187
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
187
188
|
end
|
188
189
|
|
189
190
|
# INPUT: ParamsOfAbiEncodeBoc
|
@@ -193,7 +194,7 @@ module TonClient
|
|
193
194
|
# RESPONSE: ResultOfAbiEncodeBoc
|
194
195
|
# boc: String - # # BOC encoded as base64
|
195
196
|
def encode_boc(payload, &block)
|
196
|
-
|
197
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
197
198
|
end
|
198
199
|
|
199
200
|
# INPUT: ParamsOfCalcFunctionId
|
@@ -203,7 +204,7 @@ module TonClient
|
|
203
204
|
# RESPONSE: ResultOfCalcFunctionId
|
204
205
|
# function_id: Number - # # Contract function ID
|
205
206
|
def calc_function_id(payload, &block)
|
206
|
-
|
207
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
207
208
|
end
|
208
209
|
|
209
210
|
end
|
@@ -3,12 +3,13 @@ module TonClient
|
|
3
3
|
class Boc
|
4
4
|
include CommonInstanceHelpers
|
5
5
|
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :context, :request_id, :requests
|
7
7
|
MODULE = self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
|
8
8
|
|
9
|
-
def initialize(context:
|
9
|
+
def initialize(context: nil, request_id: nil, requests: nil)
|
10
10
|
@context = context
|
11
|
-
@
|
11
|
+
@request_id = request_id
|
12
|
+
@requests = requests
|
12
13
|
end
|
13
14
|
|
14
15
|
# INPUT: ParamsOfParse
|
@@ -16,7 +17,7 @@ module TonClient
|
|
16
17
|
# RESPONSE: ResultOfParse
|
17
18
|
# parsed: Value - # # JSON containing parsed BOC
|
18
19
|
def parse_message(payload, &block)
|
19
|
-
|
20
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
20
21
|
end
|
21
22
|
|
22
23
|
# INPUT: ParamsOfParse
|
@@ -24,7 +25,7 @@ module TonClient
|
|
24
25
|
# RESPONSE: ResultOfParse
|
25
26
|
# parsed: Value - # # JSON containing parsed BOC
|
26
27
|
def parse_transaction(payload, &block)
|
27
|
-
|
28
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
28
29
|
end
|
29
30
|
|
30
31
|
# INPUT: ParamsOfParse
|
@@ -32,7 +33,7 @@ module TonClient
|
|
32
33
|
# RESPONSE: ResultOfParse
|
33
34
|
# parsed: Value - # # JSON containing parsed BOC
|
34
35
|
def parse_account(payload, &block)
|
35
|
-
|
36
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
36
37
|
end
|
37
38
|
|
38
39
|
# INPUT: ParamsOfParse
|
@@ -40,7 +41,7 @@ module TonClient
|
|
40
41
|
# RESPONSE: ResultOfParse
|
41
42
|
# parsed: Value - # # JSON containing parsed BOC
|
42
43
|
def parse_block(payload, &block)
|
43
|
-
|
44
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
44
45
|
end
|
45
46
|
|
46
47
|
# INPUT: ParamsOfParseShardstate
|
@@ -50,7 +51,7 @@ module TonClient
|
|
50
51
|
# RESPONSE: ResultOfParse
|
51
52
|
# parsed: Value - # # JSON containing parsed BOC
|
52
53
|
def parse_shardstate(payload, &block)
|
53
|
-
|
54
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
54
55
|
end
|
55
56
|
|
56
57
|
# INPUT: ParamsOfGetBlockchainConfig
|
@@ -58,7 +59,7 @@ module TonClient
|
|
58
59
|
# RESPONSE: ResultOfGetBlockchainConfig
|
59
60
|
# config_boc: String - # # Blockchain config BOC encoded as base64
|
60
61
|
def get_blockchain_config(payload, &block)
|
61
|
-
|
62
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
62
63
|
end
|
63
64
|
|
64
65
|
# INPUT: ParamsOfGetBocHash
|
@@ -66,7 +67,7 @@ module TonClient
|
|
66
67
|
# RESPONSE: ResultOfGetBocHash
|
67
68
|
# hash: String - # # BOC root hash encoded with hex
|
68
69
|
def get_boc_hash(payload, &block)
|
69
|
-
|
70
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
70
71
|
end
|
71
72
|
|
72
73
|
# INPUT: ParamsOfGetBocDepth
|
@@ -74,7 +75,7 @@ module TonClient
|
|
74
75
|
# RESPONSE: ResultOfGetBocDepth
|
75
76
|
# depth: Number - # # BOC root cell depth
|
76
77
|
def get_boc_depth(payload, &block)
|
77
|
-
|
78
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
78
79
|
end
|
79
80
|
|
80
81
|
# INPUT: ParamsOfGetCodeFromTvc
|
@@ -82,7 +83,7 @@ module TonClient
|
|
82
83
|
# RESPONSE: ResultOfGetCodeFromTvc
|
83
84
|
# code: String - # # Contract code encoded as base64
|
84
85
|
def get_code_from_tvc(payload, &block)
|
85
|
-
|
86
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
86
87
|
end
|
87
88
|
|
88
89
|
# INPUT: ParamsOfBocCacheGet
|
@@ -90,7 +91,7 @@ module TonClient
|
|
90
91
|
# RESPONSE: ResultOfBocCacheGet
|
91
92
|
# boc: String<Optional> - # # BOC encoded as base64.
|
92
93
|
def cache_get(payload, &block)
|
93
|
-
|
94
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
94
95
|
end
|
95
96
|
|
96
97
|
# INPUT: ParamsOfBocCacheSet
|
@@ -99,14 +100,14 @@ module TonClient
|
|
99
100
|
# RESPONSE: ResultOfBocCacheSet
|
100
101
|
# boc_ref: String - # # Reference to the cached BOC
|
101
102
|
def cache_set(payload, &block)
|
102
|
-
|
103
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
103
104
|
end
|
104
105
|
|
105
106
|
# INPUT: ParamsOfBocCacheUnpin
|
106
107
|
# pin: String - # # Pinned name
|
107
108
|
# boc_ref: String<Optional> - # # Reference to the cached BOC. # # If it is provided then only referenced BOC is unpinned
|
108
109
|
def cache_unpin(payload, &block)
|
109
|
-
|
110
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
110
111
|
end
|
111
112
|
|
112
113
|
# INPUT: ParamsOfEncodeBoc
|
@@ -115,7 +116,7 @@ module TonClient
|
|
115
116
|
# RESPONSE: ResultOfEncodeBoc
|
116
117
|
# boc: String - # # Encoded cell BOC or BOC cache key.
|
117
118
|
def encode_boc(payload, &block)
|
118
|
-
|
119
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
119
120
|
end
|
120
121
|
|
121
122
|
# INPUT: ParamsOfGetCodeSalt
|
@@ -124,7 +125,7 @@ module TonClient
|
|
124
125
|
# RESPONSE: ResultOfGetCodeSalt
|
125
126
|
# salt: String<Optional> - # # Contract code salt if present. # # BOC encoded as base64 or BOC handle
|
126
127
|
def get_code_salt(payload, &block)
|
127
|
-
|
128
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
128
129
|
end
|
129
130
|
|
130
131
|
# INPUT: ParamsOfSetCodeSalt
|
@@ -134,7 +135,7 @@ module TonClient
|
|
134
135
|
# RESPONSE: ResultOfSetCodeSalt
|
135
136
|
# code: String - # # Contract code with salt set. # # BOC encoded as base64 or BOC handle
|
136
137
|
def set_code_salt(payload, &block)
|
137
|
-
|
138
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
138
139
|
end
|
139
140
|
|
140
141
|
# INPUT: ParamsOfDecodeTvc
|
@@ -153,7 +154,7 @@ module TonClient
|
|
153
154
|
# split_depth: Number<Optional> - # # Is present and non-zero only in instances of large smart contracts
|
154
155
|
# compiler_version: String<Optional> - # # Compiler version, for example 'sol 0.49.0'
|
155
156
|
def decode_tvc(payload, &block)
|
156
|
-
|
157
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
157
158
|
end
|
158
159
|
|
159
160
|
# INPUT: ParamsOfEncodeTvc
|
@@ -167,7 +168,7 @@ module TonClient
|
|
167
168
|
# RESPONSE: ResultOfEncodeTvc
|
168
169
|
# tvc: String - # # Contract TVC image BOC encoded as base64 or BOC handle of boc_cache parameter was specified
|
169
170
|
def encode_tvc(payload, &block)
|
170
|
-
|
171
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
171
172
|
end
|
172
173
|
|
173
174
|
# INPUT: ParamsOfEncodeExternalInMessage
|
@@ -180,7 +181,7 @@ module TonClient
|
|
180
181
|
# message: String - # # Message BOC encoded with `base64`.
|
181
182
|
# message_id: String - # # Message id.
|
182
183
|
def encode_external_in_message(payload, &block)
|
183
|
-
|
184
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
184
185
|
end
|
185
186
|
|
186
187
|
# INPUT: ParamsOfGetCompilerVersion
|
@@ -188,7 +189,7 @@ module TonClient
|
|
188
189
|
# RESPONSE: ResultOfGetCompilerVersion
|
189
190
|
# version: String<Optional> - # # Compiler version, for example 'sol 0.49.0'
|
190
191
|
def get_compiler_version(payload, &block)
|
191
|
-
|
192
|
+
TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
192
193
|
end
|
193
194
|
|
194
195
|
end
|