ton_sdk_client 1.20.0 → 1.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -2
- data/lib/ton_sdk_client/abi.rb +201 -69
- data/lib/ton_sdk_client/boc.rb +200 -50
- data/lib/ton_sdk_client/client.rb +12 -15
- data/lib/ton_sdk_client/client_context.rb +2 -1
- data/lib/ton_sdk_client/config.rb +7 -9
- data/lib/ton_sdk_client/crypto.rb +174 -184
- data/lib/ton_sdk_client/debot.rb +13 -14
- data/lib/ton_sdk_client/interop.rb +2 -2
- data/lib/ton_sdk_client/kw_struct.rb +7 -0
- data/lib/ton_sdk_client/net.rb +44 -46
- data/lib/ton_sdk_client/processing.rb +7 -7
- data/lib/ton_sdk_client/tvm.rb +10 -12
- data/lib/ton_sdk_client/types.rb +2 -1
- data/lib/ton_sdk_client/utils.rb +18 -18
- data/lib/ton_sdk_client/version.rb +2 -2
- metadata +7 -6
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
|
@@ -320,7 +319,7 @@ module TonSdk
|
|
320
319
|
if resp.success?
|
321
320
|
yield NativeLibResponsetResult.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
|
@@ -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)
|
@@ -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
|
@@ -264,7 +262,7 @@ module TonSdk
|
|
264
262
|
) do |resp|
|
265
263
|
if resp.success?
|
266
264
|
yield NativeLibResponsetResult.new(
|
267
|
-
result: ResultOfQueryCollection.new(resp.result["result"])
|
265
|
+
result: ResultOfQueryCollection.new(result: resp.result["result"])
|
268
266
|
)
|
269
267
|
else
|
270
268
|
yield resp
|
@@ -281,7 +279,7 @@ module TonSdk
|
|
281
279
|
) do |resp|
|
282
280
|
if resp.success?
|
283
281
|
yield NativeLibResponsetResult.new(
|
284
|
-
result: ResultOfWaitForCollection.new(resp.result["result"])
|
282
|
+
result: ResultOfWaitForCollection.new(result: resp.result["result"])
|
285
283
|
)
|
286
284
|
else
|
287
285
|
yield resp
|
@@ -311,7 +309,7 @@ module TonSdk
|
|
311
309
|
) do |resp|
|
312
310
|
if resp.success?
|
313
311
|
yield NativeLibResponsetResult.new(
|
314
|
-
result: ResultOfSubscribeCollection.new(resp.result["handle"])
|
312
|
+
result: ResultOfSubscribeCollection.new(handle: resp.result["handle"])
|
315
313
|
)
|
316
314
|
else
|
317
315
|
yield resp
|
@@ -323,7 +321,7 @@ module TonSdk
|
|
323
321
|
Interop::request_to_native_lib(ctx, "net.query", params) do |resp|
|
324
322
|
if resp.success?
|
325
323
|
yield NativeLibResponsetResult.new(
|
326
|
-
result: ResultOfQuery.new(resp.result["result"])
|
324
|
+
result: ResultOfQuery.new(result: resp.result["result"])
|
327
325
|
)
|
328
326
|
else
|
329
327
|
yield resp
|
@@ -355,7 +353,7 @@ module TonSdk
|
|
355
353
|
Interop::request_to_native_lib(ctx, "net.find_last_shard_block", params) do |resp|
|
356
354
|
if resp.success?
|
357
355
|
yield NativeLibResponsetResult.new(
|
358
|
-
result: ResultOfFindLastShardBlock.new(resp.result["block_id"])
|
356
|
+
result: ResultOfFindLastShardBlock.new(block_id: resp.result["block_id"])
|
359
357
|
)
|
360
358
|
else
|
361
359
|
yield resp
|
@@ -367,7 +365,7 @@ module TonSdk
|
|
367
365
|
Interop::request_to_native_lib(ctx, "net.fetch_endpoints") do |resp|
|
368
366
|
if resp.success?
|
369
367
|
yield NativeLibResponsetResult.new(
|
370
|
-
result: EndpointsSet.new(resp.result["endpoints"])
|
368
|
+
result: EndpointsSet.new(endpoints: resp.result["endpoints"])
|
371
369
|
)
|
372
370
|
else
|
373
371
|
yield resp
|
@@ -391,7 +389,7 @@ module TonSdk
|
|
391
389
|
Interop::request_to_native_lib(ctx, "net.batch_query", params) do |resp|
|
392
390
|
if resp.success?
|
393
391
|
yield NativeLibResponsetResult.new(
|
394
|
-
result: ResultOfBatchQuery.new(resp.result["results"])
|
392
|
+
result: ResultOfBatchQuery.new(results: resp.result["results"])
|
395
393
|
)
|
396
394
|
else
|
397
395
|
yield resp
|
@@ -403,7 +401,7 @@ module TonSdk
|
|
403
401
|
Interop::request_to_native_lib(ctx, "net.aggregate_collection", params) do |resp|
|
404
402
|
if resp.success?
|
405
403
|
yield NativeLibResponsetResult.new(
|
406
|
-
result: ResultOfAggregateCollection.new(resp.result["values"])
|
404
|
+
result: ResultOfAggregateCollection.new(values: resp.result["values"])
|
407
405
|
)
|
408
406
|
else
|
409
407
|
yield resp
|
@@ -430,7 +428,7 @@ module TonSdk
|
|
430
428
|
Interop::request_to_native_lib(ctx, "net.query_counterparties", params) do |resp|
|
431
429
|
if resp.success?
|
432
430
|
yield NativeLibResponsetResult.new(
|
433
|
-
result: ResultOfQueryCollection.new(resp.result["result"])
|
431
|
+
result: ResultOfQueryCollection.new(result: resp.result["result"])
|
434
432
|
)
|
435
433
|
else
|
436
434
|
yield resp
|
@@ -457,7 +455,7 @@ module TonSdk
|
|
457
455
|
Interop::request_to_native_lib(ctx, "net.create_block_iterator", params) do |resp|
|
458
456
|
if resp.success?
|
459
457
|
yield NativeLibResponsetResult.new(
|
460
|
-
result: RegisteredIterator.new(resp.result["handle"])
|
458
|
+
result: RegisteredIterator.new(handle: resp.result["handle"])
|
461
459
|
)
|
462
460
|
else
|
463
461
|
yield resp
|
@@ -469,7 +467,7 @@ module TonSdk
|
|
469
467
|
Interop::request_to_native_lib(ctx, "net.resume_block_iterator", params) do |resp|
|
470
468
|
if resp.success?
|
471
469
|
yield NativeLibResponsetResult.new(
|
472
|
-
result: RegisteredIterator.new(resp.result["handle"])
|
470
|
+
result: RegisteredIterator.new(handle: resp.result["handle"])
|
473
471
|
)
|
474
472
|
else
|
475
473
|
yield resp
|
@@ -481,7 +479,7 @@ module TonSdk
|
|
481
479
|
Interop::request_to_native_lib(ctx, "net.create_transaction_iterator", params) do |resp|
|
482
480
|
if resp.success?
|
483
481
|
yield NativeLibResponsetResult.new(
|
484
|
-
result: RegisteredIterator.new(resp.result["handle"])
|
482
|
+
result: RegisteredIterator.new(handle: resp.result["handle"])
|
485
483
|
)
|
486
484
|
else
|
487
485
|
yield resp
|
@@ -493,7 +491,7 @@ module TonSdk
|
|
493
491
|
Interop::request_to_native_lib(ctx, "net.resume_transaction_iterator", params) do |resp|
|
494
492
|
if resp.success?
|
495
493
|
yield NativeLibResponsetResult.new(
|
496
|
-
result: RegisteredIterator.new(resp.result["handle"])
|
494
|
+
result: RegisteredIterator.new(handle: resp.result["handle"])
|
497
495
|
)
|
498
496
|
else
|
499
497
|
yield resp
|
@@ -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
|
@@ -163,7 +163,7 @@ module TonSdk
|
|
163
163
|
) do |resp|
|
164
164
|
if resp.success?
|
165
165
|
yield NativeLibResponsetResult.new(
|
166
|
-
result: ResultOfSendMessage.new(resp.result["shard_block_id"])
|
166
|
+
result: ResultOfSendMessage.new(shard_block_id: resp.result["shard_block_id"])
|
167
167
|
)
|
168
168
|
else
|
169
169
|
yield resp
|
@@ -225,4 +225,4 @@ module TonSdk
|
|
225
225
|
end
|
226
226
|
end
|
227
227
|
end
|
228
|
-
end
|
228
|
+
end
|
data/lib/ton_sdk_client/tvm.rb
CHANGED
@@ -22,7 +22,7 @@ module TonSdk
|
|
22
22
|
CONTRACT_EXECUTION_ERROR = 414
|
23
23
|
end
|
24
24
|
|
25
|
-
ExecutionOptions =
|
25
|
+
ExecutionOptions = KwStruct.new(:blockchain_config, :block_time, :block_lt, :transaction_lt) do
|
26
26
|
def initialize(blockchain_config: nil, block_time: nil, block_lt: nil, transaction_lt: nil)
|
27
27
|
super
|
28
28
|
end
|
@@ -64,15 +64,14 @@ module TonSdk
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
ParamsOfRunExecutor =
|
67
|
+
ParamsOfRunExecutor = KwStruct.new(
|
68
68
|
:message,
|
69
69
|
:account,
|
70
70
|
:execution_options,
|
71
71
|
:abi,
|
72
72
|
:skip_transaction_check,
|
73
73
|
:boc_cache,
|
74
|
-
:return_updated_account
|
75
|
-
keyword_init: true
|
74
|
+
:return_updated_account
|
76
75
|
) do
|
77
76
|
def initialize(
|
78
77
|
message:,
|
@@ -96,7 +95,7 @@ module TonSdk
|
|
96
95
|
end
|
97
96
|
end
|
98
97
|
|
99
|
-
ResultOfRunExecutor =
|
98
|
+
ResultOfRunExecutor = KwStruct.new(:transaction, :out_messages, :decoded, :account, :fees) do
|
100
99
|
def initialize(transaction:, out_messages:, decoded: nil, account:, fees:)
|
101
100
|
super
|
102
101
|
end
|
@@ -127,7 +126,7 @@ module TonSdk
|
|
127
126
|
end
|
128
127
|
end
|
129
128
|
|
130
|
-
ResultOfRunTvm =
|
129
|
+
ResultOfRunTvm = KwStruct.new(:out_messages, :decoded, :account) do
|
131
130
|
def initialize(out_messages:, decoded: nil, account:)
|
132
131
|
super
|
133
132
|
end
|
@@ -155,16 +154,15 @@ module TonSdk
|
|
155
154
|
end
|
156
155
|
end
|
157
156
|
|
158
|
-
ResultOfRunGet =
|
157
|
+
ResultOfRunGet = KwStruct.new(:output)
|
159
158
|
|
160
|
-
TransactionFees =
|
159
|
+
TransactionFees = KwStruct.new(
|
161
160
|
:in_msg_fwd_fee,
|
162
161
|
:storage_fee,
|
163
162
|
:gas_fee,
|
164
163
|
:out_msgs_fwd_fee,
|
165
164
|
:total_account_fees,
|
166
|
-
:total_output
|
167
|
-
keyword_init: true
|
165
|
+
:total_output
|
168
166
|
) do
|
169
167
|
def initialize(
|
170
168
|
in_msg_fwd_fee:,
|
@@ -236,7 +234,7 @@ module TonSdk
|
|
236
234
|
) do |resp|
|
237
235
|
if resp.success?
|
238
236
|
yield NativeLibResponsetResult.new(
|
239
|
-
result: ResultOfRunGet.new(resp.result["output"])
|
237
|
+
result: ResultOfRunGet.new(output: resp.result["output"])
|
240
238
|
)
|
241
239
|
else
|
242
240
|
yield resp
|
@@ -244,4 +242,4 @@ module TonSdk
|
|
244
242
|
end
|
245
243
|
end
|
246
244
|
end
|
247
|
-
end
|
245
|
+
end
|
data/lib/ton_sdk_client/types.rb
CHANGED
@@ -32,6 +32,7 @@ module TonSdk
|
|
32
32
|
data: error["data"]
|
33
33
|
)
|
34
34
|
else
|
35
|
+
# Some methods like unsubscribe will trigger this error. Should be refactored
|
35
36
|
raise ArgumentError.new('some arguments are wrong; provide either result or error')
|
36
37
|
end
|
37
38
|
|
@@ -41,4 +42,4 @@ module TonSdk
|
|
41
42
|
def success? = !@result.nil?
|
42
43
|
def failure? = !@error.nil?
|
43
44
|
end
|
44
|
-
end
|
45
|
+
end
|
data/lib/ton_sdk_client/utils.rb
CHANGED
@@ -32,27 +32,27 @@ module TonSdk
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
ParamsOfConvertAddress =
|
35
|
+
ParamsOfConvertAddress = KwStruct.new(:address, :output_format) do
|
36
36
|
def to_h
|
37
37
|
{
|
38
|
-
address:
|
39
|
-
output_format:
|
38
|
+
address: address,
|
39
|
+
output_format: output_format.to_h
|
40
40
|
}
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
ResultOfConvertAddress =
|
45
|
-
ParamsOfCalcStorageFee =
|
46
|
-
ResultOfCalcStorageFee =
|
44
|
+
ResultOfConvertAddress = KwStruct.new(:address)
|
45
|
+
ParamsOfCalcStorageFee = KwStruct.new(:account, :period)
|
46
|
+
ResultOfCalcStorageFee = KwStruct.new(:fee)
|
47
47
|
|
48
|
-
ParamsOfCompressZstd =
|
49
|
-
ResultOfCompressZstd =
|
48
|
+
ParamsOfCompressZstd = KwStruct.new(:uncompressed, :level)
|
49
|
+
ResultOfCompressZstd = KwStruct.new(:compressed)
|
50
50
|
|
51
|
-
ParamsOfDecompressZstd =
|
52
|
-
ResultOfDecompressZstd =
|
51
|
+
ParamsOfDecompressZstd = KwStruct.new(:compressed)
|
52
|
+
ResultOfDecompressZstd = KwStruct.new(:decompressed)
|
53
53
|
|
54
|
-
ParamsOfGetAddressType =
|
55
|
-
ResultOfGetAddressType =
|
54
|
+
ParamsOfGetAddressType = KwStruct.new(:address)
|
55
|
+
ResultOfGetAddressType = KwStruct.new(:address_type)
|
56
56
|
|
57
57
|
|
58
58
|
#
|
@@ -63,7 +63,7 @@ module TonSdk
|
|
63
63
|
Interop::request_to_native_lib(ctx, "utils.convert_address", params) do |resp|
|
64
64
|
if resp.success?
|
65
65
|
yield NativeLibResponsetResult.new(
|
66
|
-
result: ResultOfConvertAddress.new(resp.result["address"])
|
66
|
+
result: ResultOfConvertAddress.new(address: resp.result["address"])
|
67
67
|
)
|
68
68
|
else
|
69
69
|
yield resp
|
@@ -75,7 +75,7 @@ module TonSdk
|
|
75
75
|
Interop::request_to_native_lib(ctx, "utils.calc_storage_fee", params) do |resp|
|
76
76
|
if resp.success?
|
77
77
|
yield NativeLibResponsetResult.new(
|
78
|
-
result: ResultOfCalcStorageFee.new(resp.result["fee"])
|
78
|
+
result: ResultOfCalcStorageFee.new(fee: resp.result["fee"])
|
79
79
|
)
|
80
80
|
else
|
81
81
|
yield resp
|
@@ -87,7 +87,7 @@ module TonSdk
|
|
87
87
|
Interop::request_to_native_lib(ctx, "utils.compress_zstd", params) do |resp|
|
88
88
|
if resp.success?
|
89
89
|
yield NativeLibResponsetResult.new(
|
90
|
-
result: ResultOfCompressZstd.new(resp.result["compressed"])
|
90
|
+
result: ResultOfCompressZstd.new(compressed: resp.result["compressed"])
|
91
91
|
)
|
92
92
|
else
|
93
93
|
yield resp
|
@@ -99,7 +99,7 @@ module TonSdk
|
|
99
99
|
Interop::request_to_native_lib(ctx, "utils.decompress_zstd", params) do |resp|
|
100
100
|
if resp.success?
|
101
101
|
yield NativeLibResponsetResult.new(
|
102
|
-
result:
|
102
|
+
result: ResultOfDecompressZstd.new(decompressed: resp.result["decompressed"])
|
103
103
|
)
|
104
104
|
else
|
105
105
|
yield resp
|
@@ -111,7 +111,7 @@ module TonSdk
|
|
111
111
|
Interop::request_to_native_lib(ctx, "utils.get_address_type", params) do |resp|
|
112
112
|
if resp.success?
|
113
113
|
yield NativeLibResponsetResult.new(
|
114
|
-
result: ResultOfGetAddressType.new(resp.result["address_type"])
|
114
|
+
result: ResultOfGetAddressType.new(address_type: resp.result["address_type"])
|
115
115
|
)
|
116
116
|
else
|
117
117
|
yield resp
|
@@ -119,4 +119,4 @@ module TonSdk
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
122
|
-
end
|
122
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ton_sdk_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Maslakov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- lib/ton_sdk_client/debot.rb
|
103
103
|
- lib/ton_sdk_client/helper.rb
|
104
104
|
- lib/ton_sdk_client/interop.rb
|
105
|
+
- lib/ton_sdk_client/kw_struct.rb
|
105
106
|
- lib/ton_sdk_client/net.rb
|
106
107
|
- lib/ton_sdk_client/processing.rb
|
107
108
|
- lib/ton_sdk_client/tvm.rb
|
@@ -112,7 +113,7 @@ homepage: https://github.com/radianceteam/ton-client-ruby
|
|
112
113
|
licenses:
|
113
114
|
- MIT
|
114
115
|
metadata: {}
|
115
|
-
post_install_message:
|
116
|
+
post_install_message:
|
116
117
|
rdoc_options: []
|
117
118
|
require_paths:
|
118
119
|
- lib
|
@@ -127,8 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
128
|
- !ruby/object:Gem::Version
|
128
129
|
version: '0'
|
129
130
|
requirements: []
|
130
|
-
rubygems_version: 3.2.
|
131
|
-
signing_key:
|
131
|
+
rubygems_version: 3.2.22
|
132
|
+
signing_key:
|
132
133
|
specification_version: 4
|
133
134
|
summary: TON SDK client library, in Ruby and for Ruby
|
134
135
|
test_files: []
|