ton_sdk_client 1.24.0 → 1.28.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7aa3942dcf8295136874ebced4c8e69b0bd5d5bf15537aa401a3fd362bc84adc
4
- data.tar.gz: 592b046b0cb812b15573fcec3e63eb12c2006611a7a094e4194e3cb0290c5841
3
+ metadata.gz: 5bd88aaed45cdcc1f73fffa49f4d5a94209bc5de5d397cab2a17be7c66d5a8cc
4
+ data.tar.gz: 464507ab3c62098609c6e1a7509c3ccc3980d1206da9b2e27e1ad17c935c6004
5
5
  SHA512:
6
- metadata.gz: '023446187045b70c7d1afb984c58bf12ec550a631c1b1fa2ec44d2ad10661fce5e8aaa20bfb0d4d04a3b910d075663a543e98b680dbca65f921ed4b25263dff5'
7
- data.tar.gz: 2debab81288b9ebbf77af113c7483420f6420ca4de721d317ce486b3b2e439f73008a918c5b89a8119904312fe3778f62f6f6f97e47e995ab271d894b6050237
6
+ metadata.gz: f2d17c70082958459738405e2d0d82c7ca97dd88a8230f3bf8e4e978aa5612314550b3779225b36e62d6382f503156307dfc9af1e17814fb49f3114531aaccaf
7
+ data.tar.gz: e399086789160d65cf54eae69a3c6754505b08a14a7f10f07d75725455b4f9dde9d1ace169e352b15132f4580bea88b7677f5591ecbab517d7c3c911424b006c
data/CHANGELOG.md CHANGED
@@ -2,10 +2,26 @@
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.28.0
6
+ -----
7
+ * Changes `1.28.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1280--2021-12-24
8
+ * Implement Debot module
9
+
10
+ 1.27.0
11
+ -----
12
+ * Changes `1.27.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1270--2021-12-03
13
+
14
+ 1.26.0
15
+ -----
16
+ * Changes `1.26.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1260--2021-11-25
17
+
18
+ 1.25.0
19
+ -----
20
+ * Changes `1.25.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1250--2021-11-08
21
+
5
22
  1.24.0
6
23
  -----
7
- * Binaries updated to `1.24.0`;
8
- * Changes `1.24.0` (https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1240--2021-10-18);
24
+ * Changes `1.24.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1240--2021-10-18
9
25
  * **BREAKING CHANGE** All Params now require keyword arguments
10
26
 
11
27
  1.20.x
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # TON SDK client in Ruby and for Ruby
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/ton_sdk_client.svg)](https://rubygems.org/gems/ton_sdk_client)
4
- [![TON SDK version](https://img.shields.io/badge/TON%20SDK%20version-1.24.0-green)](https://github.com/tonlabs/TON-SDK/tree/1.24.0)
4
+ [![TON SDK version](https://img.shields.io/badge/TON%20SDK%20version-1.28.0-green)](https://github.com/tonlabs/TON-SDK/tree/1.28.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
 
@@ -734,7 +734,7 @@ module TonSdk
734
734
  end
735
735
  end
736
736
 
737
- ResultOfDecodeData = KwStruct.new(:data)
737
+ ResultOfDecodeAccountData = KwStruct.new(:data)
738
738
 
739
739
  ParamsOfUpdateInitialData = KwStruct.new(
740
740
  :data,
@@ -756,6 +756,19 @@ module TonSdk
756
756
 
757
757
  ResultOfUpdateInitialData = KwStruct.new(:data)
758
758
 
759
+ ParamsOfEncodeInitialData = KwStruct.new(:abi, :initial_data, :initial_pubkey, :boc_cache) do
760
+ def to_h
761
+ {
762
+ abi: abi&.to_h,
763
+ initial_data: initial_data,
764
+ initial_pubkey: initial_pubkey,
765
+ boc_cache: boc_cache&.to_h
766
+ }
767
+ end
768
+ end
769
+
770
+ ResultOfEncodeInitialData = KwStruct.new(:data)
771
+
759
772
  ParamsOfDecodeInitialData = KwStruct.new(:data, :abi) do
760
773
  def to_h
761
774
  {
@@ -767,6 +780,18 @@ module TonSdk
767
780
 
768
781
  ResultOfDecodeInitialData = KwStruct.new(:initial_pubkey, :initial_data)
769
782
 
783
+ ParamsOfDecodeBoc = KwStruct.new(:params, :boc, :allow_partial) do
784
+ def to_h
785
+ {
786
+ params: params&.map(&:to_h),
787
+ boc: boc,
788
+ allow_partial: allow_partial
789
+ }
790
+ end
791
+ end
792
+
793
+ ResultOfDecodeBoc = KwStruct.new(:data)
794
+
770
795
  #
771
796
  # functions
772
797
  #
@@ -774,7 +799,7 @@ module TonSdk
774
799
  def self.encode_message_body(ctx, params)
775
800
  Interop::request_to_native_lib(ctx, "abi.encode_message_body", params) do |resp|
776
801
  if resp.success?
777
- yield NativeLibResponsetResult.new(
802
+ yield NativeLibResponseResult.new(
778
803
  result: ResultOfEncodeMessageBody.new(
779
804
  body: resp.result["body"],
780
805
  data_to_sign: resp.result["data_to_sign"])
@@ -788,7 +813,7 @@ module TonSdk
788
813
  def self.attach_signature_to_message_body(ctx, params)
789
814
  Interop::request_to_native_lib(ctx, "abi.attach_signature_to_message_body", params) do |resp|
790
815
  if resp.success?
791
- yield NativeLibResponsetResult.new(
816
+ yield NativeLibResponseResult.new(
792
817
  result: ResultOfAttachSignatureToMessageBody.new(body: resp.result["body"])
793
818
  )
794
819
  else
@@ -800,7 +825,7 @@ module TonSdk
800
825
  def self.encode_message(ctx, params)
801
826
  Interop::request_to_native_lib(ctx, "abi.encode_message", params) do |resp|
802
827
  if resp.success?
803
- yield NativeLibResponsetResult.new(
828
+ yield NativeLibResponseResult.new(
804
829
  result: ResultOfEncodeMessage.new(
805
830
  message: resp.result["message"],
806
831
  data_to_sign: resp.result["data_to_sign"],
@@ -817,7 +842,7 @@ module TonSdk
817
842
  def self.attach_signature(ctx, params)
818
843
  Interop::request_to_native_lib(ctx, "abi.attach_signature", params) do |resp|
819
844
  if resp.success?
820
- yield NativeLibResponsetResult.new(
845
+ yield NativeLibResponseResult.new(
821
846
  result: ResultOfAttachSignature.new(
822
847
  message: resp.result["message"],
823
848
  message_id: resp.result["message_id"])
@@ -831,7 +856,7 @@ module TonSdk
831
856
  def self.decode_message(ctx, params)
832
857
  Interop::request_to_native_lib(ctx, "abi.decode_message", params) do |resp|
833
858
  if resp.success?
834
- yield NativeLibResponsetResult.new(
859
+ yield NativeLibResponseResult.new(
835
860
  result: DecodedMessageBody.from_json(resp.result)
836
861
  )
837
862
  else
@@ -843,7 +868,7 @@ module TonSdk
843
868
  def self.decode_message_body(ctx, params)
844
869
  Interop::request_to_native_lib(ctx, "abi.decode_message_body", params) do |resp|
845
870
  if resp.success?
846
- yield NativeLibResponsetResult.new(
871
+ yield NativeLibResponseResult.new(
847
872
  result: DecodedMessageBody.from_json(resp.result)
848
873
  )
849
874
  else
@@ -855,7 +880,7 @@ module TonSdk
855
880
  def self.encode_account(ctx, params)
856
881
  Interop::request_to_native_lib(ctx, "abi.encode_account", params) do |resp|
857
882
  if resp.success?
858
- yield NativeLibResponsetResult.new(
883
+ yield NativeLibResponseResult.new(
859
884
  result: ResultOfEncodeAccount.new(
860
885
  account: resp.result["account"],
861
886
  id_: resp.result["id"]
@@ -870,7 +895,7 @@ module TonSdk
870
895
  def self.encode_internal_message(ctx, params)
871
896
  Interop::request_to_native_lib(ctx, "abi.encode_internal_message", params) do |resp|
872
897
  if resp.success?
873
- yield NativeLibResponsetResult.new(
898
+ yield NativeLibResponseResult.new(
874
899
  result: ResultOfEncodeInternalMessage.new(
875
900
  message: resp.result["message"],
876
901
  address: resp.result["address"],
@@ -886,8 +911,8 @@ module TonSdk
886
911
  def self.decode_account_data(ctx, params)
887
912
  Interop::request_to_native_lib(ctx, "abi.decode_account_data", params) do |resp|
888
913
  if resp.success?
889
- yield NativeLibResponsetResult.new(
890
- result: ResultOfDecodeData.new(
914
+ yield NativeLibResponseResult.new(
915
+ result: ResultOfDecodeAccountData.new(
891
916
  data: resp.result["data"]
892
917
  )
893
918
  )
@@ -900,7 +925,7 @@ module TonSdk
900
925
  def self.update_initial_data(ctx, params)
901
926
  Interop::request_to_native_lib(ctx, "abi.update_initial_data", params) do |resp|
902
927
  if resp.success?
903
- yield NativeLibResponsetResult.new(
928
+ yield NativeLibResponseResult.new(
904
929
  result: ResultOfUpdateInitialData.new(
905
930
  data: resp.result["data"]
906
931
  )
@@ -911,10 +936,24 @@ module TonSdk
911
936
  end
912
937
  end
913
938
 
939
+ def self.encode_initial_data(ctx, params)
940
+ Interop::request_to_native_lib(ctx, "abi.encode_initial_data", params) do |resp|
941
+ if resp.success?
942
+ yield NativeLibResponseResult.new(
943
+ result: ResultOfEncodeInitialData.new(
944
+ data: resp.result["data"]
945
+ )
946
+ )
947
+ else
948
+ yield resp
949
+ end
950
+ end
951
+ end
952
+
914
953
  def self.decode_initial_data(ctx, params)
915
954
  Interop::request_to_native_lib(ctx, "abi.decode_initial_data", params) do |resp|
916
955
  if resp.success?
917
- yield NativeLibResponsetResult.new(
956
+ yield NativeLibResponseResult.new(
918
957
  result: ResultOfDecodeInitialData.new(
919
958
  initial_pubkey: resp.result["initial_pubkey"],
920
959
  initial_data: resp.result["initial_data"]
@@ -925,5 +964,19 @@ module TonSdk
925
964
  end
926
965
  end
927
966
  end
967
+
968
+ def self.decode_boc(ctx, params)
969
+ Interop::request_to_native_lib(ctx, "abi.decode_boc", params) do |resp|
970
+ if resp.success?
971
+ yield NativeLibResponseResult.new(
972
+ result: ResultOfDecodeBoc.new(
973
+ data: resp.result["data"]
974
+ )
975
+ )
976
+ else
977
+ yield resp
978
+ end
979
+ end
980
+ end
928
981
  end
929
982
  end
@@ -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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
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 NativeLibResponsetResult.new(
156
+ yield NativeLibResponseResult.new(
156
157
  result: ""
157
158
  )
158
159
  else
@@ -13,6 +13,7 @@ require_relative './abi.rb'
13
13
  require_relative './boc.rb'
14
14
  require_relative './net.rb'
15
15
  require_relative './tvm.rb'
16
+ require_relative './proofs.rb'
16
17
  require_relative './processing.rb'
17
18
  require_relative './debot.rb'
18
19