ton_sdk_client 1.15.0 → 1.16.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 +5 -0
- data/README.md +1 -1
- data/lib/ton_sdk_client/net.rb +82 -8
- data/lib/ton_sdk_client/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c809c22fee5e69dca9653a3f3ef7541e43491152f954c97dea5e4438e9981d7
|
4
|
+
data.tar.gz: 56ea8b10cbae34389691afeedb1f72f21dcf8f8568258aeb9d250ee1b7ef3231
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4602857970a2c0c5d1f7ee3917e7df637516b684b7dd69d39975d8ec866bae0556e4053e0d54ede9a831a4815027f9522f239337ba3ae8f62bac288d6f67e6be
|
7
|
+
data.tar.gz: 97857fb5c4bb08844bd973e71a8c54873f963516f398457bdf19bc7af5c33e0e47745311c66a0cb5a490242cfa5280a9dc3aaa3c0682ebbb9f25b33497c96689
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# TON SDK client in Ruby and for Ruby
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/ton_sdk_client)
|
4
|
-
[](https://github.com/tonlabs/TON-SDK/tree/1.16.0)
|
5
5
|
|
6
6
|
Ruby gem-client bindings for [TON SDK](https://github.com/tonlabs/TON-SDK) which allows one to communicate with [FreeTON](https://freeton.org) blockchain in Ruby.
|
7
7
|
|
data/lib/ton_sdk_client/net.rb
CHANGED
@@ -62,20 +62,20 @@ module TonSdk
|
|
62
62
|
ResultOfWaitForCollection = Struct.new(:result)
|
63
63
|
ResultOfQuery = Struct.new(:result)
|
64
64
|
ResultOfBatchQuery = Struct.new(:results)
|
65
|
-
ParamsOfWaitForCollection = Struct.new(:collection, :filter, :result, :timeout) do
|
65
|
+
ParamsOfWaitForCollection = Struct.new(:collection, :filter, :result, :timeout, keyword_init: true) do
|
66
66
|
def initialize(collection:, filter: nil, result:, timeout: nil)
|
67
67
|
super
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
ParamsOfSubscribeCollection = Struct.new(:collection, :filter, :result) do
|
71
|
+
ParamsOfSubscribeCollection = Struct.new(:collection, :filter, :result, keyword_init: true) do
|
72
72
|
def initialize(collection:, filter: nil, result:)
|
73
73
|
super
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
77
|
ResultOfSubscribeCollection = Struct.new(:handle)
|
78
|
-
ParamsOfQuery = Struct.new(:query, :variables) do
|
78
|
+
ParamsOfQuery = Struct.new(:query, :variables, keyword_init: true) do
|
79
79
|
def initialize(query:, variables: nil)
|
80
80
|
super
|
81
81
|
end
|
@@ -105,6 +105,11 @@ module TonSdk
|
|
105
105
|
@params = params
|
106
106
|
end
|
107
107
|
|
108
|
+
def self.new_with_type_query_counterparties(params)
|
109
|
+
@type_ = :query_counterparties
|
110
|
+
@params = params
|
111
|
+
end
|
112
|
+
|
108
113
|
def to_h
|
109
114
|
tp = {
|
110
115
|
type: Helper.sym_to_capitalized_case_str(@type_)
|
@@ -172,6 +177,60 @@ module TonSdk
|
|
172
177
|
|
173
178
|
ResultOfGetEndpoints = Struct.new(:query, :endpoints, keyword_init: true)
|
174
179
|
|
180
|
+
TransactionNode = Struct.new(
|
181
|
+
:id_,
|
182
|
+
:in_msg,
|
183
|
+
:out_msgs,
|
184
|
+
:account_addr,
|
185
|
+
:total_fees,
|
186
|
+
:aborted,
|
187
|
+
:exit_code,
|
188
|
+
keyword_init: true
|
189
|
+
) do
|
190
|
+
def initialize(id_:, in_msg:, out_msgs:, account_addr:, total_fees:, aborted:, exit_code: nil)
|
191
|
+
super
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
MessageNode = Struct.new(
|
196
|
+
:id_,
|
197
|
+
:src_transaction_id,
|
198
|
+
:dst_transaction_id,
|
199
|
+
:src,
|
200
|
+
:dst,
|
201
|
+
:value,
|
202
|
+
:bounce,
|
203
|
+
:decoded_body,
|
204
|
+
keyword_init: true
|
205
|
+
) do
|
206
|
+
def initialize(
|
207
|
+
id_:,
|
208
|
+
src_transaction_id: nil,
|
209
|
+
dst_transaction_id: nil,
|
210
|
+
src: nil,
|
211
|
+
dst: nil,
|
212
|
+
value: nil,
|
213
|
+
bounce:,
|
214
|
+
decoded_body: nil
|
215
|
+
)
|
216
|
+
super
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
ParamsOfQueryTransactionTree = Struct.new(:in_msg, :abi_registry, keyword_init: true) do
|
221
|
+
def initialize(in_msg:, abi_registry: [])
|
222
|
+
super
|
223
|
+
end
|
224
|
+
|
225
|
+
def to_h
|
226
|
+
h = super
|
227
|
+
h[:abi_registry] = self.abi_registry&.map(&:to_h)
|
228
|
+
h
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
ResultOfQueryTransactionTree = Struct.new(:messages, :transactions, keyword_init: true)
|
233
|
+
|
175
234
|
|
176
235
|
#
|
177
236
|
# functions
|
@@ -334,6 +393,21 @@ module TonSdk
|
|
334
393
|
end
|
335
394
|
end
|
336
395
|
|
396
|
+
def self.get_endpoints(ctx, params)
|
397
|
+
Interop::request_to_native_lib(ctx, "net.get_endpoints", params) do |resp|
|
398
|
+
if resp.success?
|
399
|
+
yield NativeLibResponsetResult.new(
|
400
|
+
result: ResultOfGetEndpoints.new(
|
401
|
+
query: resp.result["query"],
|
402
|
+
endpoints: resp.result["endpoints"],
|
403
|
+
)
|
404
|
+
)
|
405
|
+
else
|
406
|
+
yield resp
|
407
|
+
end
|
408
|
+
end
|
409
|
+
end
|
410
|
+
|
337
411
|
def self.query_counterparties(ctx, params)
|
338
412
|
Interop::request_to_native_lib(ctx, "net.query_counterparties", params) do |resp|
|
339
413
|
if resp.success?
|
@@ -346,13 +420,13 @@ module TonSdk
|
|
346
420
|
end
|
347
421
|
end
|
348
422
|
|
349
|
-
def self.
|
350
|
-
Interop::request_to_native_lib(ctx, "net.
|
423
|
+
def self.query_transaction_tree(ctx, params)
|
424
|
+
Interop::request_to_native_lib(ctx, "net.query_transaction_tree", params) do |resp|
|
351
425
|
if resp.success?
|
352
426
|
yield NativeLibResponsetResult.new(
|
353
|
-
result:
|
354
|
-
|
355
|
-
|
427
|
+
result: ResultOfQueryTransactionTree.new(
|
428
|
+
messages: resp.result["messages"],
|
429
|
+
transactions: resp.result["transactions"],
|
356
430
|
)
|
357
431
|
)
|
358
432
|
else
|