ton_sdk_client 1.24.0 → 1.25.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 +4 -1
- data/README.md +1 -1
- data/lib/ton_sdk_client/abi.rb +39 -13
- data/lib/ton_sdk_client/boc.rb +18 -18
- data/lib/ton_sdk_client/client.rb +5 -4
- data/lib/ton_sdk_client/client_context.rb +1 -0
- data/lib/ton_sdk_client/crypto.rb +41 -41
- data/lib/ton_sdk_client/debot.rb +6 -6
- data/lib/ton_sdk_client/interop.rb +2 -2
- data/lib/ton_sdk_client/net.rb +21 -21
- data/lib/ton_sdk_client/processing.rb +3 -3
- data/lib/ton_sdk_client/proofs.rb +47 -0
- data/lib/ton_sdk_client/tvm.rb +3 -3
- data/lib/ton_sdk_client/types.rb +1 -1
- data/lib/ton_sdk_client/utils.rb +5 -5
- data/lib/ton_sdk_client/version.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 539fe5e48336678680d4fc0a13c9f854d301c5cdd9bb3d58f4ce7b428948f29f
|
4
|
+
data.tar.gz: 34a81f973ec7bd561c2606b9285852f1def1bbf1be234654db82c5d8d98232e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b26e3dca9d5b62d0e595ab016d80e7cbb78749f236c456d19a302c140bc8220e78f945370acafbd0420ff5069c73d85813d04bb7c6255820fb8a668ee1ce140a
|
7
|
+
data.tar.gz: e3d8636910463060f6ade2636a176524f138ad29f16b9330eff191fcf692689d8dacecbc8b7ae595b04e8f09d5ed51f68a4018d1f31d21def1e732d2146b70df
|
data/CHANGELOG.md
CHANGED
@@ -2,9 +2,12 @@
|
|
2
2
|
|
3
3
|
all the changes are always according to the ones of the main TON SDK library; and on top on that, there may be additional ones
|
4
4
|
|
5
|
+
1.25.0
|
6
|
+
-----
|
7
|
+
* Changes `1.25.0` (https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1250--2021-11-08);
|
8
|
+
|
5
9
|
1.24.0
|
6
10
|
-----
|
7
|
-
* Binaries updated to `1.24.0`;
|
8
11
|
* Changes `1.24.0` (https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1240--2021-10-18);
|
9
12
|
* **BREAKING CHANGE** All Params now require keyword arguments
|
10
13
|
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# TON SDK client in Ruby and for Ruby
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/ton_sdk_client)
|
4
|
-
[](https://github.com/tonlabs/TON-SDK/tree/1.25.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/abi.rb
CHANGED
@@ -734,7 +734,7 @@ module TonSdk
|
|
734
734
|
end
|
735
735
|
end
|
736
736
|
|
737
|
-
|
737
|
+
ResultOfDecodeAccountData = KwStruct.new(:data)
|
738
738
|
|
739
739
|
ParamsOfUpdateInitialData = KwStruct.new(
|
740
740
|
:data,
|
@@ -767,6 +767,18 @@ module TonSdk
|
|
767
767
|
|
768
768
|
ResultOfDecodeInitialData = KwStruct.new(:initial_pubkey, :initial_data)
|
769
769
|
|
770
|
+
ParamsOfDecodeBoc = KwStruct.new(:params, :boc, :allow_partial) do
|
771
|
+
def to_h
|
772
|
+
{
|
773
|
+
params: params&.map(&:to_h),
|
774
|
+
boc: boc,
|
775
|
+
allow_partial: allow_partial
|
776
|
+
}
|
777
|
+
end
|
778
|
+
end
|
779
|
+
|
780
|
+
ResultOfDecodeBoc = KwStruct.new(:data)
|
781
|
+
|
770
782
|
#
|
771
783
|
# functions
|
772
784
|
#
|
@@ -774,7 +786,7 @@ module TonSdk
|
|
774
786
|
def self.encode_message_body(ctx, params)
|
775
787
|
Interop::request_to_native_lib(ctx, "abi.encode_message_body", params) do |resp|
|
776
788
|
if resp.success?
|
777
|
-
yield
|
789
|
+
yield NativeLibResponseResult.new(
|
778
790
|
result: ResultOfEncodeMessageBody.new(
|
779
791
|
body: resp.result["body"],
|
780
792
|
data_to_sign: resp.result["data_to_sign"])
|
@@ -788,7 +800,7 @@ module TonSdk
|
|
788
800
|
def self.attach_signature_to_message_body(ctx, params)
|
789
801
|
Interop::request_to_native_lib(ctx, "abi.attach_signature_to_message_body", params) do |resp|
|
790
802
|
if resp.success?
|
791
|
-
yield
|
803
|
+
yield NativeLibResponseResult.new(
|
792
804
|
result: ResultOfAttachSignatureToMessageBody.new(body: resp.result["body"])
|
793
805
|
)
|
794
806
|
else
|
@@ -800,7 +812,7 @@ module TonSdk
|
|
800
812
|
def self.encode_message(ctx, params)
|
801
813
|
Interop::request_to_native_lib(ctx, "abi.encode_message", params) do |resp|
|
802
814
|
if resp.success?
|
803
|
-
yield
|
815
|
+
yield NativeLibResponseResult.new(
|
804
816
|
result: ResultOfEncodeMessage.new(
|
805
817
|
message: resp.result["message"],
|
806
818
|
data_to_sign: resp.result["data_to_sign"],
|
@@ -817,7 +829,7 @@ module TonSdk
|
|
817
829
|
def self.attach_signature(ctx, params)
|
818
830
|
Interop::request_to_native_lib(ctx, "abi.attach_signature", params) do |resp|
|
819
831
|
if resp.success?
|
820
|
-
yield
|
832
|
+
yield NativeLibResponseResult.new(
|
821
833
|
result: ResultOfAttachSignature.new(
|
822
834
|
message: resp.result["message"],
|
823
835
|
message_id: resp.result["message_id"])
|
@@ -831,7 +843,7 @@ module TonSdk
|
|
831
843
|
def self.decode_message(ctx, params)
|
832
844
|
Interop::request_to_native_lib(ctx, "abi.decode_message", params) do |resp|
|
833
845
|
if resp.success?
|
834
|
-
yield
|
846
|
+
yield NativeLibResponseResult.new(
|
835
847
|
result: DecodedMessageBody.from_json(resp.result)
|
836
848
|
)
|
837
849
|
else
|
@@ -843,7 +855,7 @@ module TonSdk
|
|
843
855
|
def self.decode_message_body(ctx, params)
|
844
856
|
Interop::request_to_native_lib(ctx, "abi.decode_message_body", params) do |resp|
|
845
857
|
if resp.success?
|
846
|
-
yield
|
858
|
+
yield NativeLibResponseResult.new(
|
847
859
|
result: DecodedMessageBody.from_json(resp.result)
|
848
860
|
)
|
849
861
|
else
|
@@ -855,7 +867,7 @@ module TonSdk
|
|
855
867
|
def self.encode_account(ctx, params)
|
856
868
|
Interop::request_to_native_lib(ctx, "abi.encode_account", params) do |resp|
|
857
869
|
if resp.success?
|
858
|
-
yield
|
870
|
+
yield NativeLibResponseResult.new(
|
859
871
|
result: ResultOfEncodeAccount.new(
|
860
872
|
account: resp.result["account"],
|
861
873
|
id_: resp.result["id"]
|
@@ -870,7 +882,7 @@ module TonSdk
|
|
870
882
|
def self.encode_internal_message(ctx, params)
|
871
883
|
Interop::request_to_native_lib(ctx, "abi.encode_internal_message", params) do |resp|
|
872
884
|
if resp.success?
|
873
|
-
yield
|
885
|
+
yield NativeLibResponseResult.new(
|
874
886
|
result: ResultOfEncodeInternalMessage.new(
|
875
887
|
message: resp.result["message"],
|
876
888
|
address: resp.result["address"],
|
@@ -886,8 +898,8 @@ module TonSdk
|
|
886
898
|
def self.decode_account_data(ctx, params)
|
887
899
|
Interop::request_to_native_lib(ctx, "abi.decode_account_data", params) do |resp|
|
888
900
|
if resp.success?
|
889
|
-
yield
|
890
|
-
result:
|
901
|
+
yield NativeLibResponseResult.new(
|
902
|
+
result: ResultOfDecodeAccountData.new(
|
891
903
|
data: resp.result["data"]
|
892
904
|
)
|
893
905
|
)
|
@@ -900,7 +912,7 @@ module TonSdk
|
|
900
912
|
def self.update_initial_data(ctx, params)
|
901
913
|
Interop::request_to_native_lib(ctx, "abi.update_initial_data", params) do |resp|
|
902
914
|
if resp.success?
|
903
|
-
yield
|
915
|
+
yield NativeLibResponseResult.new(
|
904
916
|
result: ResultOfUpdateInitialData.new(
|
905
917
|
data: resp.result["data"]
|
906
918
|
)
|
@@ -914,7 +926,7 @@ module TonSdk
|
|
914
926
|
def self.decode_initial_data(ctx, params)
|
915
927
|
Interop::request_to_native_lib(ctx, "abi.decode_initial_data", params) do |resp|
|
916
928
|
if resp.success?
|
917
|
-
yield
|
929
|
+
yield NativeLibResponseResult.new(
|
918
930
|
result: ResultOfDecodeInitialData.new(
|
919
931
|
initial_pubkey: resp.result["initial_pubkey"],
|
920
932
|
initial_data: resp.result["initial_data"]
|
@@ -925,5 +937,19 @@ module TonSdk
|
|
925
937
|
end
|
926
938
|
end
|
927
939
|
end
|
940
|
+
|
941
|
+
def self.decode_boc(ctx, params)
|
942
|
+
Interop::request_to_native_lib(ctx, "abi.decode_boc", params) do |resp|
|
943
|
+
if resp.success?
|
944
|
+
yield NativeLibResponseResult.new(
|
945
|
+
result: ResultOfDecodeBoc.new(
|
946
|
+
data: resp.result["data"]
|
947
|
+
)
|
948
|
+
)
|
949
|
+
else
|
950
|
+
yield resp
|
951
|
+
end
|
952
|
+
end
|
953
|
+
end
|
928
954
|
end
|
929
955
|
end
|
data/lib/ton_sdk_client/boc.rb
CHANGED
@@ -141,7 +141,7 @@ module TonSdk
|
|
141
141
|
def self.parse_message(ctx, params)
|
142
142
|
Interop::request_to_native_lib(ctx, "boc.parse_message", params) do |resp|
|
143
143
|
if resp.success?
|
144
|
-
yield
|
144
|
+
yield NativeLibResponseResult.new(
|
145
145
|
result: ResultOfParse.new(parsed: resp.result["parsed"])
|
146
146
|
)
|
147
147
|
else
|
@@ -153,7 +153,7 @@ module TonSdk
|
|
153
153
|
def self.parse_transaction(ctx, params)
|
154
154
|
Interop::request_to_native_lib(ctx, "boc.parse_transaction", params) do |resp|
|
155
155
|
if resp.success?
|
156
|
-
yield
|
156
|
+
yield NativeLibResponseResult.new(
|
157
157
|
result: ResultOfParse.new(parsed: resp.result["parsed"])
|
158
158
|
)
|
159
159
|
else
|
@@ -165,7 +165,7 @@ module TonSdk
|
|
165
165
|
def self.parse_account(ctx, params)
|
166
166
|
Interop::request_to_native_lib(ctx, "boc.parse_account", params) do |resp|
|
167
167
|
if resp.success?
|
168
|
-
yield
|
168
|
+
yield NativeLibResponseResult.new(
|
169
169
|
result: ResultOfParse.new(parsed: resp.result["parsed"])
|
170
170
|
)
|
171
171
|
else
|
@@ -177,7 +177,7 @@ module TonSdk
|
|
177
177
|
def self.parse_block(ctx, params)
|
178
178
|
Interop::request_to_native_lib(ctx, "boc.parse_block", params) do |resp|
|
179
179
|
if resp.success?
|
180
|
-
yield
|
180
|
+
yield NativeLibResponseResult.new(
|
181
181
|
result: ResultOfParse.new(parsed: resp.result["parsed"])
|
182
182
|
)
|
183
183
|
else
|
@@ -189,7 +189,7 @@ module TonSdk
|
|
189
189
|
def self.parse_shardstate(ctx, params)
|
190
190
|
Interop::request_to_native_lib(ctx, "boc.parse_shardstate", params) do |resp|
|
191
191
|
if resp.success?
|
192
|
-
yield
|
192
|
+
yield NativeLibResponseResult.new(
|
193
193
|
result: ResultOfParse.new(parsed: resp.result["parsed"])
|
194
194
|
)
|
195
195
|
else
|
@@ -201,7 +201,7 @@ module TonSdk
|
|
201
201
|
def self.get_boc_hash(ctx, params)
|
202
202
|
Interop::request_to_native_lib(ctx, "boc.get_boc_hash", params) do |resp|
|
203
203
|
if resp.success?
|
204
|
-
yield
|
204
|
+
yield NativeLibResponseResult.new(
|
205
205
|
result: ResultOfGetBocHash.new(hash: resp.result["hash"])
|
206
206
|
)
|
207
207
|
else
|
@@ -213,7 +213,7 @@ module TonSdk
|
|
213
213
|
def self.get_blockchain_config(ctx, params)
|
214
214
|
Interop::request_to_native_lib(ctx, "boc.get_blockchain_config", params) do |resp|
|
215
215
|
if resp.success?
|
216
|
-
yield
|
216
|
+
yield NativeLibResponseResult.new(
|
217
217
|
result: ResultOfGetBlockchainConfig.new(
|
218
218
|
config_boc: resp.result["config_boc"]
|
219
219
|
)
|
@@ -227,7 +227,7 @@ module TonSdk
|
|
227
227
|
def self.get_boc_depth(ctx, params)
|
228
228
|
Interop::request_to_native_lib(ctx, "boc.get_boc_depth", params) do |resp|
|
229
229
|
if resp.success?
|
230
|
-
yield
|
230
|
+
yield NativeLibResponseResult.new(
|
231
231
|
result: ResultOfGetBocDepth.new(
|
232
232
|
depth: resp.result["depth"]
|
233
233
|
)
|
@@ -241,7 +241,7 @@ module TonSdk
|
|
241
241
|
def self.get_code_from_tvc(ctx, params)
|
242
242
|
Interop::request_to_native_lib(ctx, "boc.get_code_from_tvc", params) do |resp|
|
243
243
|
if resp.success?
|
244
|
-
yield
|
244
|
+
yield NativeLibResponseResult.new(
|
245
245
|
result: ResultOfGetCodeFromTvc.new(code: resp.result["code"])
|
246
246
|
)
|
247
247
|
else
|
@@ -253,7 +253,7 @@ module TonSdk
|
|
253
253
|
def self.cache_get(ctx, params)
|
254
254
|
Interop::request_to_native_lib(ctx, "boc.cache_get", params) do |resp|
|
255
255
|
if resp.success?
|
256
|
-
yield
|
256
|
+
yield NativeLibResponseResult.new(
|
257
257
|
result: ResultOfBocCacheGet.new(
|
258
258
|
boc: resp.result["boc"]
|
259
259
|
)
|
@@ -267,7 +267,7 @@ module TonSdk
|
|
267
267
|
def self.cache_set(ctx, params)
|
268
268
|
Interop::request_to_native_lib(ctx, "boc.cache_set", params) do |resp|
|
269
269
|
if resp.success?
|
270
|
-
yield
|
270
|
+
yield NativeLibResponseResult.new(
|
271
271
|
result: ResultOfBocCacheSet.new(
|
272
272
|
boc_ref: resp.result["boc_ref"]
|
273
273
|
)
|
@@ -281,7 +281,7 @@ module TonSdk
|
|
281
281
|
def self.cache_unpin(ctx, params)
|
282
282
|
Interop::request_to_native_lib(ctx, "boc.cache_unpin", params) do |resp|
|
283
283
|
if resp.success?
|
284
|
-
yield
|
284
|
+
yield NativeLibResponseResult.new(
|
285
285
|
result: nil
|
286
286
|
)
|
287
287
|
else
|
@@ -293,7 +293,7 @@ module TonSdk
|
|
293
293
|
def self.encode_boc(ctx, params)
|
294
294
|
Interop::request_to_native_lib(ctx, "boc.encode_boc", params) do |resp|
|
295
295
|
if resp.success?
|
296
|
-
yield
|
296
|
+
yield NativeLibResponseResult.new(
|
297
297
|
result: ResultOfEncodeBoc.new(
|
298
298
|
boc: resp.result["boc"]
|
299
299
|
)
|
@@ -307,7 +307,7 @@ module TonSdk
|
|
307
307
|
def self.get_code_salt(ctx, params)
|
308
308
|
Interop::request_to_native_lib(ctx, "boc.get_code_salt", params) do |resp|
|
309
309
|
if resp.success?
|
310
|
-
yield
|
310
|
+
yield NativeLibResponseResult.new(
|
311
311
|
result: ResultOfGetCodeSalt.new(
|
312
312
|
salt: resp.result["salt"]
|
313
313
|
)
|
@@ -321,7 +321,7 @@ module TonSdk
|
|
321
321
|
def self.set_code_salt(ctx, params)
|
322
322
|
Interop::request_to_native_lib(ctx, "boc.set_code_salt", params) do |resp|
|
323
323
|
if resp.success?
|
324
|
-
yield
|
324
|
+
yield NativeLibResponseResult.new(
|
325
325
|
result: ResultOfSetCodeSalt.new(
|
326
326
|
code: resp.result["code"]
|
327
327
|
)
|
@@ -335,7 +335,7 @@ module TonSdk
|
|
335
335
|
def self.decode_tvc(ctx, params)
|
336
336
|
Interop::request_to_native_lib(ctx, "boc.decode_tvc", params) do |resp|
|
337
337
|
if resp.success?
|
338
|
-
yield
|
338
|
+
yield NativeLibResponseResult.new(
|
339
339
|
result: ResultOfDecodeTvc.new(
|
340
340
|
code: resp.result["code"],
|
341
341
|
code_depth: resp.result["code_depth"],
|
@@ -359,7 +359,7 @@ module TonSdk
|
|
359
359
|
def self.encode_tvc(ctx, params)
|
360
360
|
Interop::request_to_native_lib(ctx, "boc.encode_tvc", params) do |resp|
|
361
361
|
if resp.success?
|
362
|
-
yield
|
362
|
+
yield NativeLibResponseResult.new(
|
363
363
|
result: ResultOfEncodeTvc.new(
|
364
364
|
tvc: resp.result["tvc"]
|
365
365
|
)
|
@@ -373,7 +373,7 @@ module TonSdk
|
|
373
373
|
def self.get_compiler_version(ctx, params)
|
374
374
|
Interop::request_to_native_lib(ctx, "boc.get_compiler_version", params) do |resp|
|
375
375
|
if resp.success?
|
376
|
-
yield
|
376
|
+
yield NativeLibResponseResult.new(
|
377
377
|
result: ResultOfGetCompilerVersion.new(
|
378
378
|
version: resp.result["version"]
|
379
379
|
)
|
@@ -43,6 +43,7 @@ module TonSdk
|
|
43
43
|
CANNOT_PARSE_NUMBER = 32
|
44
44
|
INTERNAL_ERROR = 33
|
45
45
|
INVALID_HANDLE = 34
|
46
|
+
LOCAL_STORAGE_ERROR = 35
|
46
47
|
end
|
47
48
|
|
48
49
|
ResultOfVersion = KwStruct.new(:version)
|
@@ -112,7 +113,7 @@ module TonSdk
|
|
112
113
|
def self.version(ctx)
|
113
114
|
Interop::request_to_native_lib(ctx, "client.version") do |resp|
|
114
115
|
if resp.success?
|
115
|
-
yield
|
116
|
+
yield NativeLibResponseResult.new(
|
116
117
|
result: ResultOfVersion.new(version: resp.result["version"])
|
117
118
|
)
|
118
119
|
else
|
@@ -124,7 +125,7 @@ module TonSdk
|
|
124
125
|
def self.get_api_reference(ctx)
|
125
126
|
Interop::request_to_native_lib(ctx, "client.get_api_reference") do |resp|
|
126
127
|
if resp.success?
|
127
|
-
yield
|
128
|
+
yield NativeLibResponseResult.new(
|
128
129
|
result: ResultOfGetApiReference.new(api: resp.result["api"])
|
129
130
|
)
|
130
131
|
else
|
@@ -137,7 +138,7 @@ module TonSdk
|
|
137
138
|
Interop::request_to_native_lib(ctx, "client.build_info") do |resp|
|
138
139
|
if resp.success?
|
139
140
|
dp_s = resp.result["dependencies"].map { |x| BuildInfoDependency.from_json(x) }
|
140
|
-
yield
|
141
|
+
yield NativeLibResponseResult.new(
|
141
142
|
result: ResultOfBuildInfo.new(
|
142
143
|
build_number: resp.result["build_number"],
|
143
144
|
dependencies: dp_s
|
@@ -152,7 +153,7 @@ module TonSdk
|
|
152
153
|
def self.resolve_app_request(ctx, params)
|
153
154
|
Interop::request_to_native_lib(ctx, "client.resolve_app_request", params) do |resp|
|
154
155
|
if resp.success?
|
155
|
-
yield
|
156
|
+
yield NativeLibResponseResult.new(
|
156
157
|
result: ""
|
157
158
|
)
|
158
159
|
else
|
@@ -243,7 +243,7 @@ module TonSdk
|
|
243
243
|
def self.factorize(ctx, params)
|
244
244
|
Interop::request_to_native_lib(ctx, "crypto.factorize", params) do |resp|
|
245
245
|
if resp.success?
|
246
|
-
yield
|
246
|
+
yield NativeLibResponseResult.new(
|
247
247
|
result: ResultOfFactorize.new(factors: resp.result["factors"])
|
248
248
|
)
|
249
249
|
else
|
@@ -255,7 +255,7 @@ module TonSdk
|
|
255
255
|
def self.modular_power(ctx, params)
|
256
256
|
Interop::request_to_native_lib(ctx, "crypto.modular_power", params) do |resp|
|
257
257
|
if resp.success?
|
258
|
-
yield
|
258
|
+
yield NativeLibResponseResult.new(
|
259
259
|
result: ResultOfModularPower.new(modular_power: resp.result["modular_power"])
|
260
260
|
)
|
261
261
|
else
|
@@ -267,7 +267,7 @@ module TonSdk
|
|
267
267
|
def self.ton_crc16(ctx, params)
|
268
268
|
Interop::request_to_native_lib(ctx, "crypto.ton_crc16", params) do |resp|
|
269
269
|
if resp.success?
|
270
|
-
yield
|
270
|
+
yield NativeLibResponseResult.new(
|
271
271
|
result: ResultOfTonCrc16.new(crc: resp.result["crc"])
|
272
272
|
)
|
273
273
|
else
|
@@ -279,7 +279,7 @@ module TonSdk
|
|
279
279
|
def self.generate_random_bytes(ctx, params)
|
280
280
|
Interop::request_to_native_lib(ctx, "crypto.generate_random_bytes", params) do |resp|
|
281
281
|
if resp.success?
|
282
|
-
yield
|
282
|
+
yield NativeLibResponseResult.new(
|
283
283
|
result: ResultOfGenerateRandomBytes.new(bytes: resp.result["bytes"])
|
284
284
|
)
|
285
285
|
else
|
@@ -291,7 +291,7 @@ module TonSdk
|
|
291
291
|
def self.convert_public_key_to_ton_safe_format(ctx, params)
|
292
292
|
Interop::request_to_native_lib(ctx, "crypto.convert_public_key_to_ton_safe_format", params) do |resp|
|
293
293
|
if resp.success?
|
294
|
-
yield
|
294
|
+
yield NativeLibResponseResult.new(
|
295
295
|
result: ResultOfConvertPublicKeyToTonSafeFormat.new(ton_public_key: resp.result["ton_public_key"])
|
296
296
|
)
|
297
297
|
else
|
@@ -303,7 +303,7 @@ module TonSdk
|
|
303
303
|
def self.generate_random_sign_keys(ctx, is_single_thread_only: false)
|
304
304
|
Interop::request_to_native_lib(ctx, "crypto.generate_random_sign_keys", nil, is_single_thread_only: is_single_thread_only) do |resp|
|
305
305
|
if resp.success?
|
306
|
-
yield
|
306
|
+
yield NativeLibResponseResult.new(
|
307
307
|
result: KeyPair.new(
|
308
308
|
public_: resp.result["public"],
|
309
309
|
secret: resp.result["secret"]
|
@@ -318,7 +318,7 @@ module TonSdk
|
|
318
318
|
def self.sign(ctx, params)
|
319
319
|
Interop::request_to_native_lib(ctx, "crypto.sign", params) do |resp|
|
320
320
|
if resp.success?
|
321
|
-
yield
|
321
|
+
yield NativeLibResponseResult.new(
|
322
322
|
result: ResultOfSign.new(
|
323
323
|
signed: resp.result["signed"],
|
324
324
|
signature: resp.result["signature"]
|
@@ -333,7 +333,7 @@ module TonSdk
|
|
333
333
|
def self.verify_signature(ctx, params)
|
334
334
|
Interop::request_to_native_lib(ctx, "crypto.verify_signature", params) do |resp|
|
335
335
|
if resp.success?
|
336
|
-
yield
|
336
|
+
yield NativeLibResponseResult.new(
|
337
337
|
result: ResultOfVerifySignature.new(unsigned: resp.result["unsigned"])
|
338
338
|
)
|
339
339
|
else
|
@@ -345,7 +345,7 @@ module TonSdk
|
|
345
345
|
def self.sha256(ctx, params)
|
346
346
|
Interop::request_to_native_lib(ctx, "crypto.sha256", params) do |resp|
|
347
347
|
if resp.success?
|
348
|
-
yield
|
348
|
+
yield NativeLibResponseResult.new(
|
349
349
|
result: ResultOfHash.new(hash: resp.result["hash"])
|
350
350
|
)
|
351
351
|
else
|
@@ -357,7 +357,7 @@ module TonSdk
|
|
357
357
|
def self.sha512(ctx, params)
|
358
358
|
Interop::request_to_native_lib(ctx, "crypto.sha512", params) do |resp|
|
359
359
|
if resp.success?
|
360
|
-
yield
|
360
|
+
yield NativeLibResponseResult.new(
|
361
361
|
result: ResultOfHash.new(hash: resp.result["hash"])
|
362
362
|
)
|
363
363
|
else
|
@@ -369,7 +369,7 @@ module TonSdk
|
|
369
369
|
def self.scrypt(ctx, params)
|
370
370
|
Interop::request_to_native_lib(ctx, "crypto.scrypt", params) do |resp|
|
371
371
|
if resp.success?
|
372
|
-
yield
|
372
|
+
yield NativeLibResponseResult.new(
|
373
373
|
result: ResultOfScrypt.new(key: resp.result["key"])
|
374
374
|
)
|
375
375
|
else
|
@@ -381,7 +381,7 @@ module TonSdk
|
|
381
381
|
def self.nacl_sign_keypair_from_secret_key(ctx, params)
|
382
382
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign_keypair_from_secret_key", params) do |resp|
|
383
383
|
if resp.success?
|
384
|
-
yield
|
384
|
+
yield NativeLibResponseResult.new(
|
385
385
|
result: KeyPair.new(
|
386
386
|
public_: resp.result["public"],
|
387
387
|
secret: resp.result["secret"]
|
@@ -396,7 +396,7 @@ module TonSdk
|
|
396
396
|
def self.nacl_sign(ctx, params)
|
397
397
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign", params) do |resp|
|
398
398
|
if resp.success?
|
399
|
-
yield
|
399
|
+
yield NativeLibResponseResult.new(
|
400
400
|
result: ResultOfNaclSign.new(signed: resp.result["signed"])
|
401
401
|
)
|
402
402
|
else
|
@@ -408,7 +408,7 @@ module TonSdk
|
|
408
408
|
def self.nacl_sign_open(ctx, params)
|
409
409
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign_open", params) do |resp|
|
410
410
|
if resp.success?
|
411
|
-
yield
|
411
|
+
yield NativeLibResponseResult.new(
|
412
412
|
result: ResultOfNaclSignOpen.new(unsigned: resp.result["unsigned"])
|
413
413
|
)
|
414
414
|
else
|
@@ -420,7 +420,7 @@ module TonSdk
|
|
420
420
|
def self.nacl_sign_detached(ctx, params)
|
421
421
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign_detached", params) do |resp|
|
422
422
|
if resp.success?
|
423
|
-
yield
|
423
|
+
yield NativeLibResponseResult.new(
|
424
424
|
result: ResultOfNaclSignDetached.new(signature: resp.result["signature"])
|
425
425
|
)
|
426
426
|
else
|
@@ -432,7 +432,7 @@ module TonSdk
|
|
432
432
|
def self.nacl_sign_detached_verify(ctx, params)
|
433
433
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign_detached_verify", params) do |resp|
|
434
434
|
if resp.success?
|
435
|
-
yield
|
435
|
+
yield NativeLibResponseResult.new(
|
436
436
|
result: ResultOfNaclSignDetachedVerify.new(succeeded: resp.result["succeeded"])
|
437
437
|
)
|
438
438
|
else
|
@@ -444,7 +444,7 @@ module TonSdk
|
|
444
444
|
def self.nacl_box_keypair(ctx)
|
445
445
|
Interop::request_to_native_lib(ctx, "crypto.nacl_box_keypair") do |resp|
|
446
446
|
if resp.success?
|
447
|
-
yield
|
447
|
+
yield NativeLibResponseResult.new(
|
448
448
|
result: KeyPair.new(
|
449
449
|
public_: resp.result["public"],
|
450
450
|
secret: resp.result["secret"]
|
@@ -459,7 +459,7 @@ module TonSdk
|
|
459
459
|
def self.nacl_box_keypair_from_secret_key(ctx, params)
|
460
460
|
Interop::request_to_native_lib(ctx, "crypto.nacl_box_keypair_from_secret_key", params) do |resp|
|
461
461
|
if resp.success?
|
462
|
-
yield
|
462
|
+
yield NativeLibResponseResult.new(
|
463
463
|
result: KeyPair.new(
|
464
464
|
public_: resp.result["public"],
|
465
465
|
secret: resp.result["secret"]
|
@@ -474,7 +474,7 @@ module TonSdk
|
|
474
474
|
def self.nacl_box(ctx, params)
|
475
475
|
Interop::request_to_native_lib(ctx, "crypto.nacl_box", params) do |resp|
|
476
476
|
if resp.success?
|
477
|
-
yield
|
477
|
+
yield NativeLibResponseResult.new(
|
478
478
|
result: ResultOfNaclBox.new(encrypted: resp.result["encrypted"])
|
479
479
|
)
|
480
480
|
else
|
@@ -486,7 +486,7 @@ module TonSdk
|
|
486
486
|
def self.nacl_box_open(ctx, params)
|
487
487
|
Interop::request_to_native_lib(ctx, "crypto.nacl_box_open", params) do |resp|
|
488
488
|
if resp.success?
|
489
|
-
yield
|
489
|
+
yield NativeLibResponseResult.new(
|
490
490
|
result: ResultOfNaclBoxOpen.new(decrypted: resp.result["decrypted"])
|
491
491
|
)
|
492
492
|
else
|
@@ -498,7 +498,7 @@ module TonSdk
|
|
498
498
|
def self.nacl_secret_box(ctx, params)
|
499
499
|
Interop::request_to_native_lib(ctx, "crypto.nacl_secret_box", params) do |resp|
|
500
500
|
if resp.success?
|
501
|
-
yield
|
501
|
+
yield NativeLibResponseResult.new(
|
502
502
|
result: ResultOfNaclBox.new(encrypted: resp.result["encrypted"])
|
503
503
|
)
|
504
504
|
else
|
@@ -510,7 +510,7 @@ module TonSdk
|
|
510
510
|
def self.nacl_secret_box_open(ctx, params)
|
511
511
|
Interop::request_to_native_lib(ctx, "crypto.nacl_secret_box_open", params) do |resp|
|
512
512
|
if resp.success?
|
513
|
-
yield
|
513
|
+
yield NativeLibResponseResult.new(
|
514
514
|
result: ResultOfNaclBoxOpen.new(decrypted: resp.result["decrypted"])
|
515
515
|
)
|
516
516
|
else
|
@@ -522,7 +522,7 @@ module TonSdk
|
|
522
522
|
def self.mnemonic_words(ctx, params)
|
523
523
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_words", params) do |resp|
|
524
524
|
if resp.success?
|
525
|
-
yield
|
525
|
+
yield NativeLibResponseResult.new(
|
526
526
|
result: ResultOfMnemonicWords.new(words: resp.result["words"])
|
527
527
|
)
|
528
528
|
else
|
@@ -534,7 +534,7 @@ module TonSdk
|
|
534
534
|
def self.mnemonic_from_random(ctx, params)
|
535
535
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_from_random", params) do |resp|
|
536
536
|
if resp.success?
|
537
|
-
yield
|
537
|
+
yield NativeLibResponseResult.new(
|
538
538
|
result: ResultOfMnemonicFromRandom.new(phrase: resp.result["phrase"])
|
539
539
|
)
|
540
540
|
else
|
@@ -546,7 +546,7 @@ module TonSdk
|
|
546
546
|
def self.mnemonic_from_entropy(ctx, params)
|
547
547
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_from_entropy", params) do |resp|
|
548
548
|
if resp.success?
|
549
|
-
yield
|
549
|
+
yield NativeLibResponseResult.new(
|
550
550
|
result: ResultOfMnemonicFromEntropy.new(phrase: resp.result["phrase"])
|
551
551
|
)
|
552
552
|
else
|
@@ -558,7 +558,7 @@ module TonSdk
|
|
558
558
|
def self.mnemonic_verify(ctx, params)
|
559
559
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_verify", params) do |resp|
|
560
560
|
if resp.success?
|
561
|
-
yield
|
561
|
+
yield NativeLibResponseResult.new(
|
562
562
|
result: ResultOfMnemonicVerify.new(valid: resp.result["valid"])
|
563
563
|
)
|
564
564
|
else
|
@@ -570,7 +570,7 @@ module TonSdk
|
|
570
570
|
def self.mnemonic_derive_sign_keys(ctx, params)
|
571
571
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_derive_sign_keys", params) do |resp|
|
572
572
|
if resp.success?
|
573
|
-
yield
|
573
|
+
yield NativeLibResponseResult.new(
|
574
574
|
result: KeyPair.new(
|
575
575
|
public_: resp.result["public"],
|
576
576
|
secret: resp.result["secret"]
|
@@ -585,7 +585,7 @@ module TonSdk
|
|
585
585
|
def self.hdkey_xprv_from_mnemonic(ctx, params)
|
586
586
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_xprv_from_mnemonic", params) do |resp|
|
587
587
|
if resp.success?
|
588
|
-
yield
|
588
|
+
yield NativeLibResponseResult.new(
|
589
589
|
result: ResultOfHDKeyXPrvFromMnemonic.new(xprv: resp.result["xprv"])
|
590
590
|
)
|
591
591
|
else
|
@@ -597,7 +597,7 @@ module TonSdk
|
|
597
597
|
def self.hdkey_derive_from_xprv(ctx, params)
|
598
598
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_derive_from_xprv", params) do |resp|
|
599
599
|
if resp.success?
|
600
|
-
yield
|
600
|
+
yield NativeLibResponseResult.new(
|
601
601
|
result: ResultOfHDKeyDeriveFromXPrv.new(xprv: resp.result["xprv"])
|
602
602
|
)
|
603
603
|
else
|
@@ -609,7 +609,7 @@ module TonSdk
|
|
609
609
|
def self.hdkey_derive_from_xprv_path(ctx, params)
|
610
610
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_derive_from_xprv_path", params) do |resp|
|
611
611
|
if resp.success?
|
612
|
-
yield
|
612
|
+
yield NativeLibResponseResult.new(
|
613
613
|
result: ResultOfHDKeyDeriveFromXPrvPath.new(xprv: resp.result["xprv"])
|
614
614
|
)
|
615
615
|
else
|
@@ -621,7 +621,7 @@ module TonSdk
|
|
621
621
|
def self.hdkey_secret_from_xprv(ctx, params)
|
622
622
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_secret_from_xprv", params) do |resp|
|
623
623
|
if resp.success?
|
624
|
-
yield
|
624
|
+
yield NativeLibResponseResult.new(
|
625
625
|
result: ResultOfHDKeySecretFromXPrv.new(secret: resp.result["secret"])
|
626
626
|
)
|
627
627
|
else
|
@@ -633,7 +633,7 @@ module TonSdk
|
|
633
633
|
def self.hdkey_public_from_xprv(ctx, params)
|
634
634
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_public_from_xprv", params) do |resp|
|
635
635
|
if resp.success?
|
636
|
-
yield
|
636
|
+
yield NativeLibResponseResult.new(
|
637
637
|
result: ResultOfHDKeyPublicFromXPrv.new(public_: resp.result["public"])
|
638
638
|
)
|
639
639
|
else
|
@@ -645,7 +645,7 @@ module TonSdk
|
|
645
645
|
def self.chacha20(ctx, params)
|
646
646
|
Interop::request_to_native_lib(ctx, "crypto.chacha20", params) do |resp|
|
647
647
|
if resp.success?
|
648
|
-
yield
|
648
|
+
yield NativeLibResponseResult.new(
|
649
649
|
result: ResultOfChaCha20.new(data: resp.result["data"])
|
650
650
|
)
|
651
651
|
else
|
@@ -684,7 +684,7 @@ module TonSdk
|
|
684
684
|
is_single_thread_only: is_single_thread_only
|
685
685
|
) do |resp|
|
686
686
|
if resp.success?
|
687
|
-
yield
|
687
|
+
yield NativeLibResponseResult.new(
|
688
688
|
result: RegisteredSigningBox.new(handle: resp.result["handle"])
|
689
689
|
)
|
690
690
|
else
|
@@ -696,7 +696,7 @@ module TonSdk
|
|
696
696
|
def self.get_signing_box(ctx, params)
|
697
697
|
Interop::request_to_native_lib(ctx, "crypto.get_signing_box", params) do |resp|
|
698
698
|
if resp.success?
|
699
|
-
yield
|
699
|
+
yield NativeLibResponseResult.new(
|
700
700
|
result: RegisteredSigningBox.new(handle: resp.result["handle"])
|
701
701
|
)
|
702
702
|
else
|
@@ -713,7 +713,7 @@ module TonSdk
|
|
713
713
|
is_single_thread_only: is_single_thread_only
|
714
714
|
) do |resp|
|
715
715
|
if resp.success?
|
716
|
-
yield
|
716
|
+
yield NativeLibResponseResult.new(
|
717
717
|
result: ResultOfSigningBoxGetPublicKey.new(pubkey: resp.result["pubkey"])
|
718
718
|
)
|
719
719
|
else
|
@@ -725,7 +725,7 @@ module TonSdk
|
|
725
725
|
def self.signing_box_sign(ctx, params)
|
726
726
|
Interop::request_to_native_lib(ctx, "crypto.signing_box_sign", params) do |resp|
|
727
727
|
if resp.success?
|
728
|
-
yield
|
728
|
+
yield NativeLibResponseResult.new(
|
729
729
|
result: ResultOfSigningBoxSign.new(signature: resp.result["signature"])
|
730
730
|
)
|
731
731
|
else
|
@@ -737,7 +737,7 @@ module TonSdk
|
|
737
737
|
def self.remove_signing_box(ctx, params)
|
738
738
|
Interop::request_to_native_lib(ctx, "crypto.remove_signing_box", params) do |resp|
|
739
739
|
if resp.success?
|
740
|
-
yield
|
740
|
+
yield NativeLibResponseResult.new(
|
741
741
|
result: nil
|
742
742
|
)
|
743
743
|
else
|
@@ -777,7 +777,7 @@ module TonSdk
|
|
777
777
|
is_single_thread_only: false
|
778
778
|
) do |resp|
|
779
779
|
if resp.success?
|
780
|
-
yield
|
780
|
+
yield NativeLibResponseResult.new(
|
781
781
|
result: RegisteredEncryptionBox.new(handle: resp.result["handle"])
|
782
782
|
)
|
783
783
|
else
|
@@ -789,7 +789,7 @@ module TonSdk
|
|
789
789
|
def self.encryption_box_get_info(ctx, params)
|
790
790
|
Interop::request_to_native_lib(ctx, "crypto.encryption_box_get_info", params) do |resp|
|
791
791
|
if resp.success?
|
792
|
-
yield
|
792
|
+
yield NativeLibResponseResult.new(
|
793
793
|
result: ResultOfEncryptionBoxGetInfo.new(info: resp.result["info"])
|
794
794
|
)
|
795
795
|
else
|
@@ -801,7 +801,7 @@ module TonSdk
|
|
801
801
|
def self.create_encryption_box(ctx, params)
|
802
802
|
Interop::request_to_native_lib(ctx, "crypto.create_encryption_box", params) do |resp|
|
803
803
|
if resp.success?
|
804
|
-
yield
|
804
|
+
yield NativeLibResponseResult.new(
|
805
805
|
result: RegisteredEncryptionBox.new(handle: resp.result["handle"])
|
806
806
|
)
|
807
807
|
else
|
data/lib/ton_sdk_client/debot.rb
CHANGED
@@ -283,7 +283,7 @@ module TonSdk
|
|
283
283
|
def self.init(ctx, params, app_browser_obj)
|
284
284
|
Interop::request_to_native_lib(ctx, "debot.init", params) do |resp|
|
285
285
|
if resp.success?
|
286
|
-
yield
|
286
|
+
yield NativeLibResponseResult.new(
|
287
287
|
result: nil
|
288
288
|
)
|
289
289
|
else
|
@@ -300,7 +300,7 @@ module TonSdk
|
|
300
300
|
is_single_thread_only: false
|
301
301
|
) do |resp|
|
302
302
|
if resp.success?
|
303
|
-
yield
|
303
|
+
yield NativeLibResponseResult.new(
|
304
304
|
result: nil
|
305
305
|
)
|
306
306
|
else
|
@@ -317,7 +317,7 @@ module TonSdk
|
|
317
317
|
is_single_thread_only: false
|
318
318
|
) do |resp|
|
319
319
|
if resp.success?
|
320
|
-
yield
|
320
|
+
yield NativeLibResponseResult.new(
|
321
321
|
# TODO: parse DebotInfo
|
322
322
|
result: ResultOfFetch.new(info: resp.result["info"])
|
323
323
|
)
|
@@ -330,7 +330,7 @@ module TonSdk
|
|
330
330
|
def self.execute(ctx, params)
|
331
331
|
Interop::request_to_native_lib(ctx, "debot.execute", params) do |resp|
|
332
332
|
if resp.success?
|
333
|
-
yield
|
333
|
+
yield NativeLibResponseResult.new(
|
334
334
|
result: nil
|
335
335
|
)
|
336
336
|
else
|
@@ -342,7 +342,7 @@ module TonSdk
|
|
342
342
|
def self.remove(ctx, params)
|
343
343
|
Interop::request_to_native_lib(ctx, "debot.remove", params) do |resp|
|
344
344
|
if resp.success?
|
345
|
-
yield
|
345
|
+
yield NativeLibResponseResult.new(
|
346
346
|
result: nil
|
347
347
|
)
|
348
348
|
else
|
@@ -354,7 +354,7 @@ module TonSdk
|
|
354
354
|
def self.send(ctx, params)
|
355
355
|
Interop::request_to_native_lib(ctx, "debot.send", params) do |resp|
|
356
356
|
if resp.success?
|
357
|
-
yield
|
357
|
+
yield NativeLibResponseResult.new(
|
358
358
|
result: nil
|
359
359
|
)
|
360
360
|
else
|
@@ -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
|
data/lib/ton_sdk_client/net.rb
CHANGED
@@ -261,7 +261,7 @@ module TonSdk
|
|
261
261
|
is_single_thread_only: false
|
262
262
|
) do |resp|
|
263
263
|
if resp.success?
|
264
|
-
yield
|
264
|
+
yield NativeLibResponseResult.new(
|
265
265
|
result: ResultOfQueryCollection.new(result: resp.result["result"])
|
266
266
|
)
|
267
267
|
else
|
@@ -278,7 +278,7 @@ module TonSdk
|
|
278
278
|
is_single_thread_only: false
|
279
279
|
) do |resp|
|
280
280
|
if resp.success?
|
281
|
-
yield
|
281
|
+
yield NativeLibResponseResult.new(
|
282
282
|
result: ResultOfWaitForCollection.new(result: resp.result["result"])
|
283
283
|
)
|
284
284
|
else
|
@@ -290,7 +290,7 @@ module TonSdk
|
|
290
290
|
def self.unsubscribe(ctx, params)
|
291
291
|
Interop::request_to_native_lib(ctx, "net.unsubscribe", params) do |resp|
|
292
292
|
if resp.success?
|
293
|
-
yield
|
293
|
+
yield NativeLibResponseResult.new(
|
294
294
|
result: ""
|
295
295
|
)
|
296
296
|
else
|
@@ -308,7 +308,7 @@ module TonSdk
|
|
308
308
|
is_single_thread_only: false
|
309
309
|
) do |resp|
|
310
310
|
if resp.success?
|
311
|
-
yield
|
311
|
+
yield NativeLibResponseResult.new(
|
312
312
|
result: ResultOfSubscribeCollection.new(handle: resp.result["handle"])
|
313
313
|
)
|
314
314
|
else
|
@@ -320,7 +320,7 @@ module TonSdk
|
|
320
320
|
def self.query(ctx, params)
|
321
321
|
Interop::request_to_native_lib(ctx, "net.query", params) do |resp|
|
322
322
|
if resp.success?
|
323
|
-
yield
|
323
|
+
yield NativeLibResponseResult.new(
|
324
324
|
result: ResultOfQuery.new(result: resp.result["result"])
|
325
325
|
)
|
326
326
|
else
|
@@ -332,7 +332,7 @@ module TonSdk
|
|
332
332
|
def self.suspend(ctx)
|
333
333
|
Interop::request_to_native_lib(ctx, "net.suspend") do |resp|
|
334
334
|
if resp.success?
|
335
|
-
yield
|
335
|
+
yield NativeLibResponseResult.new(result: "")
|
336
336
|
else
|
337
337
|
yield resp
|
338
338
|
end
|
@@ -342,7 +342,7 @@ module TonSdk
|
|
342
342
|
def self.resume(ctx)
|
343
343
|
Interop::request_to_native_lib(ctx, "net.resume") do |resp|
|
344
344
|
if resp.success?
|
345
|
-
yield
|
345
|
+
yield NativeLibResponseResult.new(result: "")
|
346
346
|
else
|
347
347
|
yield resp
|
348
348
|
end
|
@@ -352,7 +352,7 @@ module TonSdk
|
|
352
352
|
def self.find_last_shard_block(ctx, params)
|
353
353
|
Interop::request_to_native_lib(ctx, "net.find_last_shard_block", params) do |resp|
|
354
354
|
if resp.success?
|
355
|
-
yield
|
355
|
+
yield NativeLibResponseResult.new(
|
356
356
|
result: ResultOfFindLastShardBlock.new(block_id: resp.result["block_id"])
|
357
357
|
)
|
358
358
|
else
|
@@ -364,7 +364,7 @@ module TonSdk
|
|
364
364
|
def self.fetch_endpoints(ctx)
|
365
365
|
Interop::request_to_native_lib(ctx, "net.fetch_endpoints") do |resp|
|
366
366
|
if resp.success?
|
367
|
-
yield
|
367
|
+
yield NativeLibResponseResult.new(
|
368
368
|
result: EndpointsSet.new(endpoints: resp.result["endpoints"])
|
369
369
|
)
|
370
370
|
else
|
@@ -376,7 +376,7 @@ module TonSdk
|
|
376
376
|
def self.set_endpoints(ctx, params)
|
377
377
|
Interop::request_to_native_lib(ctx, "net.set_endpoints", params) do |resp|
|
378
378
|
if resp.success?
|
379
|
-
yield
|
379
|
+
yield NativeLibResponseResult.new(
|
380
380
|
result: nil
|
381
381
|
)
|
382
382
|
else
|
@@ -388,7 +388,7 @@ module TonSdk
|
|
388
388
|
def self.batch_query(ctx, params)
|
389
389
|
Interop::request_to_native_lib(ctx, "net.batch_query", params) do |resp|
|
390
390
|
if resp.success?
|
391
|
-
yield
|
391
|
+
yield NativeLibResponseResult.new(
|
392
392
|
result: ResultOfBatchQuery.new(results: resp.result["results"])
|
393
393
|
)
|
394
394
|
else
|
@@ -400,7 +400,7 @@ module TonSdk
|
|
400
400
|
def self.aggregate_collection(ctx, params)
|
401
401
|
Interop::request_to_native_lib(ctx, "net.aggregate_collection", params) do |resp|
|
402
402
|
if resp.success?
|
403
|
-
yield
|
403
|
+
yield NativeLibResponseResult.new(
|
404
404
|
result: ResultOfAggregateCollection.new(values: resp.result["values"])
|
405
405
|
)
|
406
406
|
else
|
@@ -412,7 +412,7 @@ module TonSdk
|
|
412
412
|
def self.get_endpoints(ctx, params)
|
413
413
|
Interop::request_to_native_lib(ctx, "net.get_endpoints", params) do |resp|
|
414
414
|
if resp.success?
|
415
|
-
yield
|
415
|
+
yield NativeLibResponseResult.new(
|
416
416
|
result: ResultOfGetEndpoints.new(
|
417
417
|
query: resp.result["query"],
|
418
418
|
endpoints: resp.result["endpoints"],
|
@@ -427,7 +427,7 @@ module TonSdk
|
|
427
427
|
def self.query_counterparties(ctx, params)
|
428
428
|
Interop::request_to_native_lib(ctx, "net.query_counterparties", params) do |resp|
|
429
429
|
if resp.success?
|
430
|
-
yield
|
430
|
+
yield NativeLibResponseResult.new(
|
431
431
|
result: ResultOfQueryCollection.new(result: resp.result["result"])
|
432
432
|
)
|
433
433
|
else
|
@@ -439,7 +439,7 @@ module TonSdk
|
|
439
439
|
def self.query_transaction_tree(ctx, params)
|
440
440
|
Interop::request_to_native_lib(ctx, "net.query_transaction_tree", params) do |resp|
|
441
441
|
if resp.success?
|
442
|
-
yield
|
442
|
+
yield NativeLibResponseResult.new(
|
443
443
|
result: ResultOfQueryTransactionTree.new(
|
444
444
|
messages: resp.result["messages"],
|
445
445
|
transactions: resp.result["transactions"],
|
@@ -454,7 +454,7 @@ module TonSdk
|
|
454
454
|
def self.create_block_iterator(ctx, params)
|
455
455
|
Interop::request_to_native_lib(ctx, "net.create_block_iterator", params) do |resp|
|
456
456
|
if resp.success?
|
457
|
-
yield
|
457
|
+
yield NativeLibResponseResult.new(
|
458
458
|
result: RegisteredIterator.new(handle: resp.result["handle"])
|
459
459
|
)
|
460
460
|
else
|
@@ -466,7 +466,7 @@ module TonSdk
|
|
466
466
|
def self.resume_block_iterator(ctx, params)
|
467
467
|
Interop::request_to_native_lib(ctx, "net.resume_block_iterator", params) do |resp|
|
468
468
|
if resp.success?
|
469
|
-
yield
|
469
|
+
yield NativeLibResponseResult.new(
|
470
470
|
result: RegisteredIterator.new(handle: resp.result["handle"])
|
471
471
|
)
|
472
472
|
else
|
@@ -478,7 +478,7 @@ module TonSdk
|
|
478
478
|
def self.create_transaction_iterator(ctx, params)
|
479
479
|
Interop::request_to_native_lib(ctx, "net.create_transaction_iterator", params) do |resp|
|
480
480
|
if resp.success?
|
481
|
-
yield
|
481
|
+
yield NativeLibResponseResult.new(
|
482
482
|
result: RegisteredIterator.new(handle: resp.result["handle"])
|
483
483
|
)
|
484
484
|
else
|
@@ -490,7 +490,7 @@ module TonSdk
|
|
490
490
|
def self.resume_transaction_iterator(ctx, params)
|
491
491
|
Interop::request_to_native_lib(ctx, "net.resume_transaction_iterator", params) do |resp|
|
492
492
|
if resp.success?
|
493
|
-
yield
|
493
|
+
yield NativeLibResponseResult.new(
|
494
494
|
result: RegisteredIterator.new(handle: resp.result["handle"])
|
495
495
|
)
|
496
496
|
else
|
@@ -502,7 +502,7 @@ module TonSdk
|
|
502
502
|
def self.iterator_next(ctx, params)
|
503
503
|
Interop::request_to_native_lib(ctx, "net.iterator_next", params) do |resp|
|
504
504
|
if resp.success?
|
505
|
-
yield
|
505
|
+
yield NativeLibResponseResult.new(
|
506
506
|
result: ResultOfIteratorNext.new(
|
507
507
|
items: resp.result["items"],
|
508
508
|
has_more: resp.result["has_more"],
|
@@ -518,7 +518,7 @@ module TonSdk
|
|
518
518
|
def self.remove_iterator(ctx, params)
|
519
519
|
Interop::request_to_native_lib(ctx, "net.remove_iterator", params) do |resp|
|
520
520
|
if resp.success?
|
521
|
-
yield
|
521
|
+
yield NativeLibResponseResult.new(
|
522
522
|
result: nil
|
523
523
|
)
|
524
524
|
else
|
@@ -162,7 +162,7 @@ module TonSdk
|
|
162
162
|
is_single_thread_only: false
|
163
163
|
) do |resp|
|
164
164
|
if resp.success?
|
165
|
-
yield
|
165
|
+
yield NativeLibResponseResult.new(
|
166
166
|
result: ResultOfSendMessage.new(shard_block_id: resp.result["shard_block_id"])
|
167
167
|
)
|
168
168
|
else
|
@@ -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"],
|
@@ -0,0 +1,47 @@
|
|
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
|
+
#
|
20
|
+
# functions
|
21
|
+
#
|
22
|
+
|
23
|
+
def self.proof_block_data(ctx, params)
|
24
|
+
Interop::request_to_native_lib(ctx, "proofs.proof_block_data", params) do |resp|
|
25
|
+
if resp.success?
|
26
|
+
yield NativeLibResponseResult.new(
|
27
|
+
result: ""
|
28
|
+
)
|
29
|
+
else
|
30
|
+
yield resp
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.proof_transaction_data(ctx, params)
|
36
|
+
Interop::request_to_native_lib(ctx, "proofs.proof_transaction_data", params) do |resp|
|
37
|
+
if resp.success?
|
38
|
+
yield NativeLibResponseResult.new(
|
39
|
+
result: ""
|
40
|
+
)
|
41
|
+
else
|
42
|
+
yield resp
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/ton_sdk_client/tvm.rb
CHANGED
@@ -189,7 +189,7 @@ module TonSdk
|
|
189
189
|
is_single_thread_only: false
|
190
190
|
) do |resp|
|
191
191
|
if resp.success?
|
192
|
-
yield
|
192
|
+
yield NativeLibResponseResult.new(
|
193
193
|
result: ResultOfRunExecutor.new(
|
194
194
|
transaction: resp.result["transaction"],
|
195
195
|
out_messages: resp.result["out_messages"],
|
@@ -212,7 +212,7 @@ module TonSdk
|
|
212
212
|
is_single_thread_only: false
|
213
213
|
) do |resp|
|
214
214
|
if resp.success?
|
215
|
-
yield
|
215
|
+
yield NativeLibResponseResult.new(
|
216
216
|
result: ResultOfRunTvm.new(
|
217
217
|
out_messages: resp.result["out_messages"],
|
218
218
|
decoded: resp.result["decoded"],
|
@@ -233,7 +233,7 @@ module TonSdk
|
|
233
233
|
is_single_thread_only: false
|
234
234
|
) do |resp|
|
235
235
|
if resp.success?
|
236
|
-
yield
|
236
|
+
yield NativeLibResponseResult.new(
|
237
237
|
result: ResultOfRunGet.new(output: resp.result["output"])
|
238
238
|
)
|
239
239
|
else
|
data/lib/ton_sdk_client/types.rb
CHANGED
data/lib/ton_sdk_client/utils.rb
CHANGED
@@ -62,7 +62,7 @@ module TonSdk
|
|
62
62
|
def self.convert_address(ctx, params)
|
63
63
|
Interop::request_to_native_lib(ctx, "utils.convert_address", params) do |resp|
|
64
64
|
if resp.success?
|
65
|
-
yield
|
65
|
+
yield NativeLibResponseResult.new(
|
66
66
|
result: ResultOfConvertAddress.new(address: resp.result["address"])
|
67
67
|
)
|
68
68
|
else
|
@@ -74,7 +74,7 @@ module TonSdk
|
|
74
74
|
def self.calc_storage_fee(ctx, params)
|
75
75
|
Interop::request_to_native_lib(ctx, "utils.calc_storage_fee", params) do |resp|
|
76
76
|
if resp.success?
|
77
|
-
yield
|
77
|
+
yield NativeLibResponseResult.new(
|
78
78
|
result: ResultOfCalcStorageFee.new(fee: resp.result["fee"])
|
79
79
|
)
|
80
80
|
else
|
@@ -86,7 +86,7 @@ module TonSdk
|
|
86
86
|
def self.compress_zstd(ctx, params)
|
87
87
|
Interop::request_to_native_lib(ctx, "utils.compress_zstd", params) do |resp|
|
88
88
|
if resp.success?
|
89
|
-
yield
|
89
|
+
yield NativeLibResponseResult.new(
|
90
90
|
result: ResultOfCompressZstd.new(compressed: resp.result["compressed"])
|
91
91
|
)
|
92
92
|
else
|
@@ -98,7 +98,7 @@ module TonSdk
|
|
98
98
|
def self.decompress_zstd(ctx, params)
|
99
99
|
Interop::request_to_native_lib(ctx, "utils.decompress_zstd", params) do |resp|
|
100
100
|
if resp.success?
|
101
|
-
yield
|
101
|
+
yield NativeLibResponseResult.new(
|
102
102
|
result: ResultOfDecompressZstd.new(decompressed: resp.result["decompressed"])
|
103
103
|
)
|
104
104
|
else
|
@@ -110,7 +110,7 @@ module TonSdk
|
|
110
110
|
def self.get_address_type(ctx, params)
|
111
111
|
Interop::request_to_native_lib(ctx, "utils.get_address_type", params) do |resp|
|
112
112
|
if resp.success?
|
113
|
-
yield
|
113
|
+
yield NativeLibResponseResult.new(
|
114
114
|
result: ResultOfGetAddressType.new(address_type: resp.result["address_type"])
|
115
115
|
)
|
116
116
|
else
|
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.25.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Maslakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/ton_sdk_client/kw_struct.rb
|
106
106
|
- lib/ton_sdk_client/net.rb
|
107
107
|
- lib/ton_sdk_client/processing.rb
|
108
|
+
- lib/ton_sdk_client/proofs.rb
|
108
109
|
- lib/ton_sdk_client/tvm.rb
|
109
110
|
- lib/ton_sdk_client/types.rb
|
110
111
|
- lib/ton_sdk_client/utils.rb
|