ton_sdk_client 1.22.0 → 1.27.0
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/CHANGELOG.md +17 -0
- data/README.md +2 -2
- data/lib/ton_sdk_client/abi.rb +263 -78
- data/lib/ton_sdk_client/boc.rb +213 -63
- data/lib/ton_sdk_client/client.rb +17 -19
- data/lib/ton_sdk_client/client_context.rb +3 -1
- data/lib/ton_sdk_client/config.rb +7 -9
- data/lib/ton_sdk_client/crypto.rb +183 -225
- data/lib/ton_sdk_client/debot.rb +19 -20
- data/lib/ton_sdk_client/interop.rb +4 -4
- data/lib/ton_sdk_client/kw_struct.rb +7 -0
- data/lib/ton_sdk_client/net.rb +65 -67
- data/lib/ton_sdk_client/processing.rb +10 -10
- data/lib/ton_sdk_client/proofs.rb +61 -0
- data/lib/ton_sdk_client/tvm.rb +13 -15
- data/lib/ton_sdk_client/types.rb +3 -2
- data/lib/ton_sdk_client/utils.rb +23 -23
- data/lib/ton_sdk_client/version.rb +2 -2
- metadata +7 -5
data/lib/ton_sdk_client/debot.rb
CHANGED
@@ -23,7 +23,7 @@ module TonSdk
|
|
23
23
|
OPERATION_REJECTED = 812
|
24
24
|
end
|
25
25
|
|
26
|
-
DebotAction =
|
26
|
+
DebotAction = KwStruct.new(:description, :name, :action_type, :to, :attributes, :misc) do
|
27
27
|
def to_h
|
28
28
|
{
|
29
29
|
description: self.description,
|
@@ -49,9 +49,9 @@ module TonSdk
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
ParamsOfStart =
|
52
|
+
ParamsOfStart = KwStruct.new(:debot_handle)
|
53
53
|
|
54
|
-
RegisteredDebot =
|
54
|
+
RegisteredDebot = KwStruct.new(:debot_handle, :debot_abi, :info) do
|
55
55
|
def to_h = {
|
56
56
|
debot_handle: @debot_handle,
|
57
57
|
debot_abi: @debot_abi,
|
@@ -207,9 +207,9 @@ module TonSdk
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
|
-
ParamsOfFetch =
|
210
|
+
ParamsOfFetch = KwStruct.new(:address)
|
211
211
|
|
212
|
-
ParamsOfExecute =
|
212
|
+
ParamsOfExecute = KwStruct.new(:debot_handle, :action) do
|
213
213
|
def to_h
|
214
214
|
{
|
215
215
|
debot_handle: @debot_handle,
|
@@ -218,9 +218,9 @@ module TonSdk
|
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
|
-
ParamsOfSend =
|
222
|
-
ParamsOfInit =
|
223
|
-
DebotInfo =
|
221
|
+
ParamsOfSend = KwStruct.new(:debot_handle, :message)
|
222
|
+
ParamsOfInit = KwStruct.new(:address)
|
223
|
+
DebotInfo = KwStruct.new(
|
224
224
|
:name,
|
225
225
|
:version,
|
226
226
|
:publisher,
|
@@ -231,8 +231,7 @@ module TonSdk
|
|
231
231
|
:language,
|
232
232
|
:dabi,
|
233
233
|
:icon,
|
234
|
-
:interfaces
|
235
|
-
keyword_init: true
|
234
|
+
:interfaces
|
236
235
|
) do
|
237
236
|
def initialize(
|
238
237
|
name: nil,
|
@@ -251,8 +250,8 @@ module TonSdk
|
|
251
250
|
end
|
252
251
|
end
|
253
252
|
|
254
|
-
ResultOfFetch =
|
255
|
-
Spending =
|
253
|
+
ResultOfFetch = KwStruct.new(:info)
|
254
|
+
Spending = KwStruct.new(:amount, :dst)
|
256
255
|
|
257
256
|
class DebotActivity
|
258
257
|
private_class_method :new
|
@@ -284,7 +283,7 @@ module TonSdk
|
|
284
283
|
def self.init(ctx, params, app_browser_obj)
|
285
284
|
Interop::request_to_native_lib(ctx, "debot.init", params) do |resp|
|
286
285
|
if resp.success?
|
287
|
-
yield
|
286
|
+
yield NativeLibResponseResult.new(
|
288
287
|
result: nil
|
289
288
|
)
|
290
289
|
else
|
@@ -301,7 +300,7 @@ module TonSdk
|
|
301
300
|
is_single_thread_only: false
|
302
301
|
) do |resp|
|
303
302
|
if resp.success?
|
304
|
-
yield
|
303
|
+
yield NativeLibResponseResult.new(
|
305
304
|
result: nil
|
306
305
|
)
|
307
306
|
else
|
@@ -318,9 +317,9 @@ module TonSdk
|
|
318
317
|
is_single_thread_only: false
|
319
318
|
) do |resp|
|
320
319
|
if resp.success?
|
321
|
-
yield
|
320
|
+
yield NativeLibResponseResult.new(
|
322
321
|
# TODO: parse DebotInfo
|
323
|
-
result: ResultOfFetch.new(resp.result["info"])
|
322
|
+
result: ResultOfFetch.new(info: resp.result["info"])
|
324
323
|
)
|
325
324
|
else
|
326
325
|
yield resp
|
@@ -331,7 +330,7 @@ module TonSdk
|
|
331
330
|
def self.execute(ctx, params)
|
332
331
|
Interop::request_to_native_lib(ctx, "debot.execute", params) do |resp|
|
333
332
|
if resp.success?
|
334
|
-
yield
|
333
|
+
yield NativeLibResponseResult.new(
|
335
334
|
result: nil
|
336
335
|
)
|
337
336
|
else
|
@@ -343,7 +342,7 @@ module TonSdk
|
|
343
342
|
def self.remove(ctx, params)
|
344
343
|
Interop::request_to_native_lib(ctx, "debot.remove", params) do |resp|
|
345
344
|
if resp.success?
|
346
|
-
yield
|
345
|
+
yield NativeLibResponseResult.new(
|
347
346
|
result: nil
|
348
347
|
)
|
349
348
|
else
|
@@ -355,7 +354,7 @@ module TonSdk
|
|
355
354
|
def self.send(ctx, params)
|
356
355
|
Interop::request_to_native_lib(ctx, "debot.send", params) do |resp|
|
357
356
|
if resp.success?
|
358
|
-
yield
|
357
|
+
yield NativeLibResponseResult.new(
|
359
358
|
result: nil
|
360
359
|
)
|
361
360
|
else
|
@@ -364,4 +363,4 @@ module TonSdk
|
|
364
363
|
end
|
365
364
|
end
|
366
365
|
end
|
367
|
-
end
|
366
|
+
end
|
@@ -137,7 +137,7 @@ module TonSdk
|
|
137
137
|
is_single_thread_only: true
|
138
138
|
)
|
139
139
|
function_name_tc_str = TcStringData.from_string(function_name)
|
140
|
-
function_params_json_str = function_params&.to_h
|
140
|
+
function_params_json_str = function_params&.to_h&.to_json || ""
|
141
141
|
function_params_json_tc_str = TcStringData.from_string(function_params_json_str)
|
142
142
|
|
143
143
|
@sm = Concurrent::Semaphore.new(1)
|
@@ -172,12 +172,12 @@ module TonSdk
|
|
172
172
|
|
173
173
|
when TcResponseCodes::SUCCESS
|
174
174
|
if block_given?
|
175
|
-
yield
|
175
|
+
yield NativeLibResponseResult.new(result: tc_data_json_content)
|
176
176
|
end
|
177
177
|
|
178
178
|
when TcResponseCodes::ERROR
|
179
179
|
if block_given?
|
180
|
-
yield
|
180
|
+
yield NativeLibResponseResult.new(error: tc_data_json_content)
|
181
181
|
end
|
182
182
|
|
183
183
|
when TcResponseCodes::NOP
|
@@ -227,4 +227,4 @@ module TonSdk
|
|
227
227
|
self.tc_request_sync(ctx, function_name_tc_str, function_params_json_tc_str)
|
228
228
|
end
|
229
229
|
end
|
230
|
-
end
|
230
|
+
end
|
data/lib/ton_sdk_client/net.rb
CHANGED
@@ -37,7 +37,7 @@ module TonSdk
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
ParamsOfQueryCollection =
|
40
|
+
ParamsOfQueryCollection = KwStruct.new(:collection, :filter, :result, :order, :limit) do
|
41
41
|
def initialize(collection: , filter: nil, result: , order: [], limit: nil)
|
42
42
|
super
|
43
43
|
end
|
@@ -58,32 +58,32 @@ module TonSdk
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
ResultOfQueryCollection =
|
62
|
-
ResultOfWaitForCollection =
|
63
|
-
ResultOfQuery =
|
64
|
-
ResultOfBatchQuery =
|
65
|
-
ParamsOfWaitForCollection =
|
61
|
+
ResultOfQueryCollection = KwStruct.new(:result)
|
62
|
+
ResultOfWaitForCollection = KwStruct.new(:result)
|
63
|
+
ResultOfQuery = KwStruct.new(:result)
|
64
|
+
ResultOfBatchQuery = KwStruct.new(:results)
|
65
|
+
ParamsOfWaitForCollection = KwStruct.new(:collection, :filter, :result, :timeout) do
|
66
66
|
def initialize(collection:, filter: nil, result:, timeout: nil)
|
67
67
|
super
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
ParamsOfSubscribeCollection =
|
71
|
+
ParamsOfSubscribeCollection = KwStruct.new(:collection, :filter, :result) do
|
72
72
|
def initialize(collection:, filter: nil, result:)
|
73
73
|
super
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
ResultOfSubscribeCollection =
|
78
|
-
ParamsOfQuery =
|
77
|
+
ResultOfSubscribeCollection = KwStruct.new(:handle)
|
78
|
+
ParamsOfQuery = KwStruct.new(:query, :variables) do
|
79
79
|
def initialize(query:, variables: nil)
|
80
80
|
super
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
ParamsOfFindLastShardBlock =
|
85
|
-
ResultOfFindLastShardBlock =
|
86
|
-
EndpointsSet =
|
84
|
+
ParamsOfFindLastShardBlock = KwStruct.new(:address)
|
85
|
+
ResultOfFindLastShardBlock = KwStruct.new(:block_id)
|
86
|
+
EndpointsSet = KwStruct.new(:endpoints)
|
87
87
|
|
88
88
|
class ParamsOfQueryOperation
|
89
89
|
private_class_method :new
|
@@ -120,7 +120,7 @@ module TonSdk
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
-
ParamsOfBatchQuery =
|
123
|
+
ParamsOfBatchQuery = KwStruct.new(:operations) do
|
124
124
|
def to_h
|
125
125
|
{
|
126
126
|
operations: self.operations.compact.map(&:to_h)
|
@@ -128,7 +128,7 @@ module TonSdk
|
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
|
-
ParamsOfAggregateCollection =
|
131
|
+
ParamsOfAggregateCollection = KwStruct.new(:collection, :filter, :fields) do
|
132
132
|
def initialize(collection:, filter: nil, fields: [])
|
133
133
|
super
|
134
134
|
end
|
@@ -167,32 +167,31 @@ module TonSdk
|
|
167
167
|
end
|
168
168
|
end
|
169
169
|
|
170
|
-
ResultOfAggregateCollection =
|
170
|
+
ResultOfAggregateCollection = KwStruct.new(:values)
|
171
171
|
|
172
|
-
ParamsOfQueryCounterparties =
|
172
|
+
ParamsOfQueryCounterparties = KwStruct.new(:account, :result, :first, :after) do
|
173
173
|
def initialize(account:, result:, first: nil, after: nil)
|
174
174
|
super
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
178
|
-
ResultOfGetEndpoints =
|
178
|
+
ResultOfGetEndpoints = KwStruct.new(:query, :endpoints)
|
179
179
|
|
180
|
-
TransactionNode =
|
180
|
+
TransactionNode = KwStruct.new(
|
181
181
|
:id_,
|
182
182
|
:in_msg,
|
183
183
|
:out_msgs,
|
184
184
|
:account_addr,
|
185
185
|
:total_fees,
|
186
186
|
:aborted,
|
187
|
-
:exit_code
|
188
|
-
keyword_init: true
|
187
|
+
:exit_code
|
189
188
|
) do
|
190
189
|
def initialize(id_:, in_msg:, out_msgs:, account_addr:, total_fees:, aborted:, exit_code: nil)
|
191
190
|
super
|
192
191
|
end
|
193
192
|
end
|
194
193
|
|
195
|
-
MessageNode =
|
194
|
+
MessageNode = KwStruct.new(
|
196
195
|
:id_,
|
197
196
|
:src_transaction_id,
|
198
197
|
:dst_transaction_id,
|
@@ -200,8 +199,7 @@ module TonSdk
|
|
200
199
|
:dst,
|
201
200
|
:value,
|
202
201
|
:bounce,
|
203
|
-
:decoded_body
|
204
|
-
keyword_init: true
|
202
|
+
:decoded_body
|
205
203
|
) do
|
206
204
|
def initialize(
|
207
205
|
id_:,
|
@@ -217,7 +215,7 @@ module TonSdk
|
|
217
215
|
end
|
218
216
|
end
|
219
217
|
|
220
|
-
ParamsOfQueryTransactionTree =
|
218
|
+
ParamsOfQueryTransactionTree = KwStruct.new(:in_msg, :abi_registry, :timeout) do
|
221
219
|
def initialize(in_msg:, abi_registry: [], timeout: nil)
|
222
220
|
super
|
223
221
|
end
|
@@ -228,23 +226,23 @@ module TonSdk
|
|
228
226
|
h
|
229
227
|
end
|
230
228
|
end
|
231
|
-
ResultOfQueryTransactionTree =
|
229
|
+
ResultOfQueryTransactionTree = KwStruct.new(:messages, :transactions)
|
232
230
|
|
233
|
-
ParamsOfCreateBlockIterator =
|
234
|
-
RegisteredIterator =
|
235
|
-
ParamsOfResumeBlockIterator =
|
236
|
-
ParamsOfCreateTransactionIterator =
|
237
|
-
ParamsOfResumeTransactionIterator =
|
231
|
+
ParamsOfCreateBlockIterator = KwStruct.new(:start_time, :end_time, :shard_filter, :result)
|
232
|
+
RegisteredIterator = KwStruct.new(:handle)
|
233
|
+
ParamsOfResumeBlockIterator = KwStruct.new(:resume_state)
|
234
|
+
ParamsOfCreateTransactionIterator = KwStruct.new(:start_time, :end_time, :shard_filter, :accounts_filter, :result, :include_transfers)
|
235
|
+
ParamsOfResumeTransactionIterator = KwStruct.new(:resume_state, :accounts_filter) do
|
238
236
|
def initialize(resume_state:, accounts_filter: nil)
|
239
237
|
super
|
240
238
|
end
|
241
239
|
end
|
242
|
-
ParamsOfIteratorNext =
|
240
|
+
ParamsOfIteratorNext = KwStruct.new(:iterator, :limit, :return_resume_state) do
|
243
241
|
def initialize(iterator:, limit: nil, return_resume_state: nil)
|
244
242
|
super
|
245
243
|
end
|
246
244
|
end
|
247
|
-
ResultOfIteratorNext =
|
245
|
+
ResultOfIteratorNext = KwStruct.new(:items, :has_more, :resume_state) do
|
248
246
|
def initialize(items: [], has_more:, resume_state: nil)
|
249
247
|
super
|
250
248
|
end
|
@@ -263,8 +261,8 @@ module TonSdk
|
|
263
261
|
is_single_thread_only: false
|
264
262
|
) do |resp|
|
265
263
|
if resp.success?
|
266
|
-
yield
|
267
|
-
result: ResultOfQueryCollection.new(resp.result["result"])
|
264
|
+
yield NativeLibResponseResult.new(
|
265
|
+
result: ResultOfQueryCollection.new(result: resp.result["result"])
|
268
266
|
)
|
269
267
|
else
|
270
268
|
yield resp
|
@@ -280,8 +278,8 @@ module TonSdk
|
|
280
278
|
is_single_thread_only: false
|
281
279
|
) do |resp|
|
282
280
|
if resp.success?
|
283
|
-
yield
|
284
|
-
result: ResultOfWaitForCollection.new(resp.result["result"])
|
281
|
+
yield NativeLibResponseResult.new(
|
282
|
+
result: ResultOfWaitForCollection.new(result: resp.result["result"])
|
285
283
|
)
|
286
284
|
else
|
287
285
|
yield resp
|
@@ -292,7 +290,7 @@ module TonSdk
|
|
292
290
|
def self.unsubscribe(ctx, params)
|
293
291
|
Interop::request_to_native_lib(ctx, "net.unsubscribe", params) do |resp|
|
294
292
|
if resp.success?
|
295
|
-
yield
|
293
|
+
yield NativeLibResponseResult.new(
|
296
294
|
result: ""
|
297
295
|
)
|
298
296
|
else
|
@@ -310,8 +308,8 @@ module TonSdk
|
|
310
308
|
is_single_thread_only: false
|
311
309
|
) do |resp|
|
312
310
|
if resp.success?
|
313
|
-
yield
|
314
|
-
result: ResultOfSubscribeCollection.new(resp.result["handle"])
|
311
|
+
yield NativeLibResponseResult.new(
|
312
|
+
result: ResultOfSubscribeCollection.new(handle: resp.result["handle"])
|
315
313
|
)
|
316
314
|
else
|
317
315
|
yield resp
|
@@ -322,8 +320,8 @@ module TonSdk
|
|
322
320
|
def self.query(ctx, params)
|
323
321
|
Interop::request_to_native_lib(ctx, "net.query", params) do |resp|
|
324
322
|
if resp.success?
|
325
|
-
yield
|
326
|
-
result: ResultOfQuery.new(resp.result["result"])
|
323
|
+
yield NativeLibResponseResult.new(
|
324
|
+
result: ResultOfQuery.new(result: resp.result["result"])
|
327
325
|
)
|
328
326
|
else
|
329
327
|
yield resp
|
@@ -334,7 +332,7 @@ module TonSdk
|
|
334
332
|
def self.suspend(ctx)
|
335
333
|
Interop::request_to_native_lib(ctx, "net.suspend") do |resp|
|
336
334
|
if resp.success?
|
337
|
-
yield
|
335
|
+
yield NativeLibResponseResult.new(result: "")
|
338
336
|
else
|
339
337
|
yield resp
|
340
338
|
end
|
@@ -344,7 +342,7 @@ module TonSdk
|
|
344
342
|
def self.resume(ctx)
|
345
343
|
Interop::request_to_native_lib(ctx, "net.resume") do |resp|
|
346
344
|
if resp.success?
|
347
|
-
yield
|
345
|
+
yield NativeLibResponseResult.new(result: "")
|
348
346
|
else
|
349
347
|
yield resp
|
350
348
|
end
|
@@ -354,8 +352,8 @@ module TonSdk
|
|
354
352
|
def self.find_last_shard_block(ctx, params)
|
355
353
|
Interop::request_to_native_lib(ctx, "net.find_last_shard_block", params) do |resp|
|
356
354
|
if resp.success?
|
357
|
-
yield
|
358
|
-
result: ResultOfFindLastShardBlock.new(resp.result["block_id"])
|
355
|
+
yield NativeLibResponseResult.new(
|
356
|
+
result: ResultOfFindLastShardBlock.new(block_id: resp.result["block_id"])
|
359
357
|
)
|
360
358
|
else
|
361
359
|
yield resp
|
@@ -366,8 +364,8 @@ module TonSdk
|
|
366
364
|
def self.fetch_endpoints(ctx)
|
367
365
|
Interop::request_to_native_lib(ctx, "net.fetch_endpoints") do |resp|
|
368
366
|
if resp.success?
|
369
|
-
yield
|
370
|
-
result: EndpointsSet.new(resp.result["endpoints"])
|
367
|
+
yield NativeLibResponseResult.new(
|
368
|
+
result: EndpointsSet.new(endpoints: resp.result["endpoints"])
|
371
369
|
)
|
372
370
|
else
|
373
371
|
yield resp
|
@@ -378,7 +376,7 @@ module TonSdk
|
|
378
376
|
def self.set_endpoints(ctx, params)
|
379
377
|
Interop::request_to_native_lib(ctx, "net.set_endpoints", params) do |resp|
|
380
378
|
if resp.success?
|
381
|
-
yield
|
379
|
+
yield NativeLibResponseResult.new(
|
382
380
|
result: nil
|
383
381
|
)
|
384
382
|
else
|
@@ -390,8 +388,8 @@ module TonSdk
|
|
390
388
|
def self.batch_query(ctx, params)
|
391
389
|
Interop::request_to_native_lib(ctx, "net.batch_query", params) do |resp|
|
392
390
|
if resp.success?
|
393
|
-
yield
|
394
|
-
result: ResultOfBatchQuery.new(resp.result["results"])
|
391
|
+
yield NativeLibResponseResult.new(
|
392
|
+
result: ResultOfBatchQuery.new(results: resp.result["results"])
|
395
393
|
)
|
396
394
|
else
|
397
395
|
yield resp
|
@@ -402,8 +400,8 @@ module TonSdk
|
|
402
400
|
def self.aggregate_collection(ctx, params)
|
403
401
|
Interop::request_to_native_lib(ctx, "net.aggregate_collection", params) do |resp|
|
404
402
|
if resp.success?
|
405
|
-
yield
|
406
|
-
result: ResultOfAggregateCollection.new(resp.result["values"])
|
403
|
+
yield NativeLibResponseResult.new(
|
404
|
+
result: ResultOfAggregateCollection.new(values: resp.result["values"])
|
407
405
|
)
|
408
406
|
else
|
409
407
|
yield resp
|
@@ -414,7 +412,7 @@ module TonSdk
|
|
414
412
|
def self.get_endpoints(ctx, params)
|
415
413
|
Interop::request_to_native_lib(ctx, "net.get_endpoints", params) do |resp|
|
416
414
|
if resp.success?
|
417
|
-
yield
|
415
|
+
yield NativeLibResponseResult.new(
|
418
416
|
result: ResultOfGetEndpoints.new(
|
419
417
|
query: resp.result["query"],
|
420
418
|
endpoints: resp.result["endpoints"],
|
@@ -429,8 +427,8 @@ module TonSdk
|
|
429
427
|
def self.query_counterparties(ctx, params)
|
430
428
|
Interop::request_to_native_lib(ctx, "net.query_counterparties", params) do |resp|
|
431
429
|
if resp.success?
|
432
|
-
yield
|
433
|
-
result: ResultOfQueryCollection.new(resp.result["result"])
|
430
|
+
yield NativeLibResponseResult.new(
|
431
|
+
result: ResultOfQueryCollection.new(result: resp.result["result"])
|
434
432
|
)
|
435
433
|
else
|
436
434
|
yield resp
|
@@ -441,7 +439,7 @@ module TonSdk
|
|
441
439
|
def self.query_transaction_tree(ctx, params)
|
442
440
|
Interop::request_to_native_lib(ctx, "net.query_transaction_tree", params) do |resp|
|
443
441
|
if resp.success?
|
444
|
-
yield
|
442
|
+
yield NativeLibResponseResult.new(
|
445
443
|
result: ResultOfQueryTransactionTree.new(
|
446
444
|
messages: resp.result["messages"],
|
447
445
|
transactions: resp.result["transactions"],
|
@@ -456,8 +454,8 @@ module TonSdk
|
|
456
454
|
def self.create_block_iterator(ctx, params)
|
457
455
|
Interop::request_to_native_lib(ctx, "net.create_block_iterator", params) do |resp|
|
458
456
|
if resp.success?
|
459
|
-
yield
|
460
|
-
result: RegisteredIterator.new(resp.result["handle"])
|
457
|
+
yield NativeLibResponseResult.new(
|
458
|
+
result: RegisteredIterator.new(handle: resp.result["handle"])
|
461
459
|
)
|
462
460
|
else
|
463
461
|
yield resp
|
@@ -468,8 +466,8 @@ module TonSdk
|
|
468
466
|
def self.resume_block_iterator(ctx, params)
|
469
467
|
Interop::request_to_native_lib(ctx, "net.resume_block_iterator", params) do |resp|
|
470
468
|
if resp.success?
|
471
|
-
yield
|
472
|
-
result: RegisteredIterator.new(resp.result["handle"])
|
469
|
+
yield NativeLibResponseResult.new(
|
470
|
+
result: RegisteredIterator.new(handle: resp.result["handle"])
|
473
471
|
)
|
474
472
|
else
|
475
473
|
yield resp
|
@@ -480,8 +478,8 @@ module TonSdk
|
|
480
478
|
def self.create_transaction_iterator(ctx, params)
|
481
479
|
Interop::request_to_native_lib(ctx, "net.create_transaction_iterator", params) do |resp|
|
482
480
|
if resp.success?
|
483
|
-
yield
|
484
|
-
result: RegisteredIterator.new(resp.result["handle"])
|
481
|
+
yield NativeLibResponseResult.new(
|
482
|
+
result: RegisteredIterator.new(handle: resp.result["handle"])
|
485
483
|
)
|
486
484
|
else
|
487
485
|
yield resp
|
@@ -492,8 +490,8 @@ module TonSdk
|
|
492
490
|
def self.resume_transaction_iterator(ctx, params)
|
493
491
|
Interop::request_to_native_lib(ctx, "net.resume_transaction_iterator", params) do |resp|
|
494
492
|
if resp.success?
|
495
|
-
yield
|
496
|
-
result: RegisteredIterator.new(resp.result["handle"])
|
493
|
+
yield NativeLibResponseResult.new(
|
494
|
+
result: RegisteredIterator.new(handle: resp.result["handle"])
|
497
495
|
)
|
498
496
|
else
|
499
497
|
yield resp
|
@@ -504,7 +502,7 @@ module TonSdk
|
|
504
502
|
def self.iterator_next(ctx, params)
|
505
503
|
Interop::request_to_native_lib(ctx, "net.iterator_next", params) do |resp|
|
506
504
|
if resp.success?
|
507
|
-
yield
|
505
|
+
yield NativeLibResponseResult.new(
|
508
506
|
result: ResultOfIteratorNext.new(
|
509
507
|
items: resp.result["items"],
|
510
508
|
has_more: resp.result["has_more"],
|
@@ -520,7 +518,7 @@ module TonSdk
|
|
520
518
|
def self.remove_iterator(ctx, params)
|
521
519
|
Interop::request_to_native_lib(ctx, "net.remove_iterator", params) do |resp|
|
522
520
|
if resp.success?
|
523
|
-
yield
|
521
|
+
yield NativeLibResponseResult.new(
|
524
522
|
result: nil
|
525
523
|
)
|
526
524
|
else
|
@@ -530,4 +528,4 @@ module TonSdk
|
|
530
528
|
end
|
531
529
|
|
532
530
|
end
|
533
|
-
end
|
531
|
+
end
|
@@ -23,7 +23,7 @@ module TonSdk
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
ResultOfSendMessage =
|
26
|
+
ResultOfSendMessage = KwStruct.new(:shard_block_id)
|
27
27
|
|
28
28
|
class ParamsOfWaitForTransaction
|
29
29
|
attr_reader :abi, :message, :shard_block_id, :send_events
|
@@ -129,17 +129,17 @@ module TonSdk
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
DecodedOutput =
|
132
|
+
DecodedOutput = KwStruct.new(:out_messages, :output) do
|
133
133
|
def initialize(out_messages:, output: nil)
|
134
134
|
super
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
-
ParamsOfProcessMessage =
|
138
|
+
ParamsOfProcessMessage = KwStruct.new(:message_encode_params, :send_events) do
|
139
139
|
def to_h
|
140
140
|
{
|
141
|
-
message_encode_params:
|
142
|
-
send_events:
|
141
|
+
message_encode_params: message_encode_params.to_h,
|
142
|
+
send_events: send_events
|
143
143
|
}
|
144
144
|
end
|
145
145
|
end
|
@@ -162,8 +162,8 @@ module TonSdk
|
|
162
162
|
is_single_thread_only: false
|
163
163
|
) do |resp|
|
164
164
|
if resp.success?
|
165
|
-
yield
|
166
|
-
result: ResultOfSendMessage.new(resp.result["shard_block_id"])
|
165
|
+
yield NativeLibResponseResult.new(
|
166
|
+
result: ResultOfSendMessage.new(shard_block_id: resp.result["shard_block_id"])
|
167
167
|
)
|
168
168
|
else
|
169
169
|
yield resp
|
@@ -184,7 +184,7 @@ module TonSdk
|
|
184
184
|
is_single_thread_only: false
|
185
185
|
) do |resp|
|
186
186
|
if resp.success?
|
187
|
-
yield
|
187
|
+
yield NativeLibResponseResult.new(
|
188
188
|
result: ResultOfProcessMessage.new(
|
189
189
|
transaction: resp.result["transaction"],
|
190
190
|
out_messages: resp.result["out_messages"],
|
@@ -211,7 +211,7 @@ module TonSdk
|
|
211
211
|
is_single_thread_only: false
|
212
212
|
) do |resp|
|
213
213
|
if resp.success?
|
214
|
-
yield
|
214
|
+
yield NativeLibResponseResult.new(
|
215
215
|
result: ResultOfProcessMessage.new(
|
216
216
|
transaction: resp.result["transaction"],
|
217
217
|
out_messages: resp.result["out_messages"],
|
@@ -225,4 +225,4 @@ module TonSdk
|
|
225
225
|
end
|
226
226
|
end
|
227
227
|
end
|
228
|
-
end
|
228
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module TonSdk
|
2
|
+
module Proofs
|
3
|
+
|
4
|
+
#
|
5
|
+
# types
|
6
|
+
#
|
7
|
+
|
8
|
+
module ErrorCode
|
9
|
+
INVALID_DATA = 901
|
10
|
+
PROOF_CHECK_FAILED = 902
|
11
|
+
INTERNAL_ERROR = 903
|
12
|
+
DATA_DIFFERS_FROM_PROVEN = 904
|
13
|
+
end
|
14
|
+
|
15
|
+
ParamsOfProofBlockData = KwStruct.new(:block)
|
16
|
+
|
17
|
+
ParamsOfProofTransactionData = KwStruct.new(:transaction)
|
18
|
+
|
19
|
+
ParamsOfProofMessageData = KwStruct.new(:message)
|
20
|
+
|
21
|
+
#
|
22
|
+
# functions
|
23
|
+
#
|
24
|
+
|
25
|
+
def self.proof_block_data(ctx, params)
|
26
|
+
Interop::request_to_native_lib(ctx, "proofs.proof_block_data", params) do |resp|
|
27
|
+
if resp.success?
|
28
|
+
yield NativeLibResponseResult.new(
|
29
|
+
result: ""
|
30
|
+
)
|
31
|
+
else
|
32
|
+
yield resp
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.proof_transaction_data(ctx, params)
|
38
|
+
Interop::request_to_native_lib(ctx, "proofs.proof_transaction_data", params) do |resp|
|
39
|
+
if resp.success?
|
40
|
+
yield NativeLibResponseResult.new(
|
41
|
+
result: ""
|
42
|
+
)
|
43
|
+
else
|
44
|
+
yield resp
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.proof_message_data(ctx, params)
|
50
|
+
Interop::request_to_native_lib(ctx, "proofs.proof_message_data", params) do |resp|
|
51
|
+
if resp.success?
|
52
|
+
yield NativeLibResponseResult.new(
|
53
|
+
result: ""
|
54
|
+
)
|
55
|
+
else
|
56
|
+
yield resp
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|