ton_sdk_client 1.22.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8acd2e283e07e29ebb3ddf0d5517db4ff5417baa61d921c30bd190a12ba88e1a
4
- data.tar.gz: a66af55f8cb5d31e578dc770944a1334fa0b90e5b8043a67a3347f529cd5f011
3
+ metadata.gz: de68cde3bf2772d6e041682e0c3b72653dbc10c88f9d3da6f6e38805392c79d9
4
+ data.tar.gz: 711422d1ea613eade3fa88d04f6b04ac820ea7ad4d5cc290fb820fef7d9af531
5
5
  SHA512:
6
- metadata.gz: 1851aa1391362eef92b4a646de3c0969ce6501010edd7ff66c266cc5f4d77f11fe11787c9ece962bd85bc6c31ea3f0b84861b33435137977d8cef1332145bdfd
7
- data.tar.gz: 4cc944c9d95d9441447cd7e137fc055d3438a09c8851a3a5ba5f5c630007476d153f622acda647fd9dd3caf3cccf3f25e4744a73e7b2ae794b5d5724439b37b3
6
+ metadata.gz: 91abf0f72519493a45ab76f48099204cd7a00660d7da98a88bbf26d0ce9e73d8a45c8cbeba5555bce24c0ed5017abcb42e880a88a0f3c054b12b4555b2a3b51e
7
+ data.tar.gz: fad6857d97f33b0b38ea00a6e107225e90a3dca58aafbc48ac61f9c28e4e608a2bc6c3de6d70b327503cd967ee7a4437f3c5bdc07237ea6a1b6ea5c9bd73df98
data/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
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.27.0
6
+ -----
7
+ * Changes `1.27.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1270--2021-12-03
8
+
9
+ 1.26.0
10
+ -----
11
+ * Changes `1.26.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1260--2021-11-25
12
+
13
+ 1.25.0
14
+ -----
15
+ * Changes `1.25.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1250--2021-11-08
16
+
17
+ 1.24.0
18
+ -----
19
+ * Changes `1.24.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1240--2021-10-18
20
+ * **BREAKING CHANGE** All Params now require keyword arguments
21
+
5
22
  1.20.x
6
23
  -----
7
24
  * NetworkConfig and AbiContract have been changed (not mentioned explicitly in Changelog of TON SDK )
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # TON SDK client in Ruby and for Ruby
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/ton_sdk_client.png)](https://badge.fury.io/rb/ton_sdk_client)
4
- [![TON SDK version](https://img.shields.io/badge/TON%20SDK%20version-1.22.0-green)](https://github.com/tonlabs/TON-SDK/tree/1.22.0)
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.26.0-green)](https://github.com/tonlabs/TON-SDK/tree/1.26.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
 
@@ -39,15 +39,23 @@ module TonSdk
39
39
  end
40
40
  end
41
41
 
42
- FunctionHeader = Struct.new(:expire, :time, :pubkey, keyword_init: true)
42
+ FunctionHeader = KwStruct.new(:expire, :time, :pubkey)
43
43
 
44
- CallSet = Struct.new(:function_name, :header, :input, keyword_init: true) do
44
+ CallSet = KwStruct.new(:function_name, :header, :input) do
45
45
  def initialize(function_name:, header: nil, input: nil)
46
46
  super
47
47
  end
48
+
49
+ def to_h
50
+ {
51
+ function_name: function_name,
52
+ header: header.to_h,
53
+ input: input
54
+ }
55
+ end
48
56
  end
49
57
 
50
- DeploySet = Struct.new(:tvc, :workchain_id, :initial_data, :initial_pubkey, keyword_init: true) do
58
+ DeploySet = KwStruct.new(:tvc, :workchain_id, :initial_data, :initial_pubkey) do
51
59
  def initialize(tvc:, workchain_id: nil, initial_data: nil, initial_pubkey: nil)
52
60
  super
53
61
  end
@@ -95,19 +103,19 @@ module TonSdk
95
103
  end
96
104
 
97
105
  STATIC_INIT_SOURCE_TYPES = [:message, :state_init, :tvc]
98
- StateInitSource = Struct.new(
99
- :type_,
106
+ # TODO: Refactor with subclasses?
107
+ StateInitSource = KwStruct.new(
108
+ :type,
100
109
  :source,
101
110
  :code,
102
111
  :data,
103
112
  :library,
104
113
  :tvc,
105
114
  :public_key,
106
- :init_params,
107
- keyword_init: true
115
+ :init_params
108
116
  ) do
109
117
  def initialize(
110
- type_:,
118
+ type:,
111
119
  source: nil,
112
120
  code: nil,
113
121
  data: nil,
@@ -116,42 +124,42 @@ module TonSdk
116
124
  public_key: nil,
117
125
  init_params: nil
118
126
  )
119
- unless STATIC_INIT_SOURCE_TYPES.include?(type_)
120
- raise ArgumentError.new("unknown type: #{type_}; known types: #{STATIC_INIT_SOURCE_TYPES}")
127
+ unless STATIC_INIT_SOURCE_TYPES.include?(type)
128
+ raise ArgumentError.new("unknown type: #{type}; known types: #{STATIC_INIT_SOURCE_TYPES}")
121
129
  end
122
130
  super
123
131
  end
124
132
 
125
133
  def to_h
126
134
  h1 = {
127
- type: Helper.sym_to_capitalized_case_str(@type_)
135
+ type: Helper.sym_to_capitalized_case_str(type)
128
136
  }
129
137
 
130
- h2 = case @type_
138
+ h2 = case type
131
139
  when :message
132
140
  {
133
- source: @source.to_h
141
+ source: source.to_h
134
142
  }
135
143
  when :state_init
136
144
  {
137
- code: @code,
138
- data: @data,
139
- library: @library
145
+ code: code,
146
+ data: data,
147
+ library: library
140
148
  }
141
149
  when :tvc
142
150
  {
143
- public_key: @public_key,
144
- init_params: @init_params.to_h
151
+ public_key: public_key,
152
+ init_params: init_params.to_h
145
153
  }
146
154
  else
147
- raise ArgumentError.new("unknown type: #{@type_}; known types: #{STATIC_INIT_SOURCE_TYPES}")
155
+ raise ArgumentError.new("unknown type: #{type}; known types: #{STATIC_INIT_SOURCE_TYPES}")
148
156
  end
149
157
 
150
158
  h1.merge(h2)
151
159
  end
152
160
  end
153
161
 
154
- StateInitParams = Struct.new(:abi, :value, keyword_init: true) do
162
+ StateInitParams = KwStruct.new(:abi, :value) do
155
163
  def initialize(abi:, value:)
156
164
  super
157
165
  end
@@ -159,19 +167,18 @@ module TonSdk
159
167
 
160
168
 
161
169
  MESSAGE_SOURCE_TYPES = [:encoded, :encoding_params]
162
- MessageSource = Struct.new(
163
- :type_,
170
+ MessageSource = KwStruct.new(
171
+ :type,
164
172
  :message,
165
173
  :abi,
166
174
  :address,
167
175
  :deploy_set,
168
176
  :call_set,
169
177
  :signer,
170
- :processing_try_index,
171
- keyword_init: true
178
+ :processing_try_index
172
179
  ) do
173
180
  def initialize(
174
- type_:,
181
+ type:,
175
182
  message: nil,
176
183
  abi: nil,
177
184
  address: nil,
@@ -180,8 +187,8 @@ module TonSdk
180
187
  signer: nil,
181
188
  processing_try_index: 0
182
189
  )
183
- unless MESSAGE_SOURCE_TYPES.include?(type_)
184
- raise ArgumentError.new("unknown type: #{type_}; known types: #{MESSAGE_SOURCE_TYPES}")
190
+ unless MESSAGE_SOURCE_TYPES.include?(type)
191
+ raise ArgumentError.new("unknown type: #{type}; known types: #{MESSAGE_SOURCE_TYPES}")
185
192
  end
186
193
 
187
194
  super
@@ -189,23 +196,23 @@ module TonSdk
189
196
 
190
197
  def to_h
191
198
  h1 = {
192
- type: Helper.sym_to_capitalized_case_str(@type_)
199
+ type: Helper.sym_to_capitalized_case_str(type)
193
200
  }
194
201
 
195
- h2 = case @type_
202
+ h2 = case type
196
203
  when :encoded
197
204
  {
198
- message: @message,
199
- abi: @abi.nil? ? nil : @abi.to_h
205
+ message: message,
206
+ abi: abi&.to_h
200
207
  }
201
208
  when :encoding_params
202
209
  {
203
- abi: @abi.to_h,
204
- address: @address,
205
- deploy_set: @deploy_set.nil? ? nil : @deploy_set.to_h,
206
- call_set: @call_set.nil? ? nil : @call_set.to_h,
207
- signer: @signer.to_h,
208
- processing_try_index: @processing_try_index
210
+ abi: abi.to_h,
211
+ address: address,
212
+ deploy_set: deploy_set&.to_h,
213
+ call_set: call_set&.to_h,
214
+ signer: signer&.to_h,
215
+ processing_try_index: processing_try_index
209
216
  }
210
217
  end
211
218
 
@@ -213,34 +220,50 @@ module TonSdk
213
220
  end
214
221
  end
215
222
 
216
- ParamsOfEncodeMessageBody = Struct.new(:abi, :call_set, :is_internal, :signer, :processing_try_index, keyword_init: true) do
217
- def initialize(abi:, call_set:, is_internal:, signer:, processing_try_index: 0)
218
- super
223
+ ParamsOfEncodeMessageBody = KwStruct.new(
224
+ :abi,
225
+ :call_set,
226
+ :is_internal,
227
+ :signer,
228
+ :processing_try_index
229
+ ) do
230
+ def to_h
231
+ {
232
+ abi: abi.to_h,
233
+ call_set: call_set.to_h,
234
+ is_internal: is_internal,
235
+ signer: signer.to_h,
236
+ processing_try_index: processing_try_index
237
+ }
219
238
  end
220
239
  end
221
240
 
222
- ResultOfEncodeMessageBody = Struct.new(:body, :data_to_sign, keyword_init: true) do
241
+ ResultOfEncodeMessageBody = KwStruct.new(:body, :data_to_sign) do
223
242
  def initialize(body:, data_to_sign: nil)
224
243
  super
225
244
  end
226
245
  end
227
246
 
228
- ParamsOfAttachSignatureToMessageBody = Struct.new(:abi, :public_key, :message, :signature, keyword_init: true) do
229
- def initialize(abi:, public_key:, message:, signature:)
230
- super
247
+ ParamsOfAttachSignatureToMessageBody = KwStruct.new(:abi, :public_key, :message, :signature) do
248
+ def to_h
249
+ {
250
+ abi: abi.to_h,
251
+ public_key: public_key,
252
+ message: message,
253
+ signature: signature
254
+ }
231
255
  end
232
256
  end
233
257
 
234
- ResultOfAttachSignatureToMessageBody = Struct.new(:body)
258
+ ResultOfAttachSignatureToMessageBody = KwStruct.new(:body)
235
259
 
236
- ParamsOfEncodeMessage = Struct.new(
260
+ ParamsOfEncodeMessage = KwStruct.new(
237
261
  :abi,
238
262
  :address,
239
263
  :deploy_set,
240
264
  :call_set,
241
265
  :signer,
242
- :processing_try_index,
243
- keyword_init: true
266
+ :processing_try_index
244
267
  ) do
245
268
  def initialize(
246
269
  abi:,
@@ -252,30 +275,57 @@ module TonSdk
252
275
  )
253
276
  super
254
277
  end
278
+
279
+ def to_h
280
+ {
281
+ abi: abi.to_h,
282
+ address: address,
283
+ deploy_set: deploy_set&.to_h,
284
+ call_set: call_set&.to_h,
285
+ signer: signer.to_h,
286
+ processing_try_index: processing_try_index
287
+ }
288
+ end
255
289
  end
256
290
 
257
- ResultOfEncodeMessage = Struct.new(:message, :data_to_sign, :address, :message_id, keyword_init: true) do
291
+ ResultOfEncodeMessage = KwStruct.new(:message, :data_to_sign, :address, :message_id) do
258
292
  def initialize(message:, data_to_sign: nil, address:, message_id:)
259
293
  super
260
294
  end
261
295
  end
262
296
 
263
- ParamsOfAttachSignature = Struct.new(:abi, :public_key, :message, :signature, keyword_init: true) do
297
+ ParamsOfAttachSignature = KwStruct.new(:abi, :public_key, :message, :signature) do
264
298
  def initialize(abi:, public_key:, message:, signature:)
265
299
  super
266
300
  end
301
+
302
+ def to_h
303
+ {
304
+ abi: abi&.to_h,
305
+ public_key: public_key,
306
+ message: message,
307
+ signature: signature
308
+ }
309
+ end
267
310
  end
268
311
 
269
- ResultOfAttachSignature = Struct.new(:message, :message_id, keyword_init: true) do
312
+ ResultOfAttachSignature = KwStruct.new(:message, :message_id) do
270
313
  def initialize(message:, message_id:)
271
314
  super
272
315
  end
273
316
  end
274
317
 
275
- ParamsOfDecodeMessage = Struct.new(:abi, :message, keyword_init: true) do
318
+ ParamsOfDecodeMessage = KwStruct.new(:abi, :message) do
276
319
  def initialize(abi:, message:)
277
320
  super
278
321
  end
322
+
323
+ def to_h
324
+ {
325
+ abi: abi&.to_h,
326
+ message: message
327
+ }
328
+ end
279
329
  end
280
330
 
281
331
  class DecodedMessageBody
@@ -341,19 +391,39 @@ module TonSdk
341
391
  end
342
392
  end
343
393
 
344
- ParamsOfDecodeMessageBody = Struct.new(:abi, :body, :is_internal, keyword_init: true) do
394
+ ParamsOfDecodeMessageBody = KwStruct.new(:abi, :body, :is_internal) do
345
395
  def initialize(abi:, body:, is_internal:)
346
396
  super
347
397
  end
398
+
399
+ def to_h
400
+ {
401
+ abi: abi&.to_h,
402
+ body: body,
403
+ is_internal: is_internal
404
+ }
405
+ end
348
406
  end
349
407
 
350
- ParamsOfEncodeAccount = Struct.new(:state_init, :balance, :last_trans_lt, :last_paid, keyword_init: true) do
351
- def initialize(state_init:, balance: nil, last_trans_lt: nil, last_paid: nil)
352
- super
408
+ ParamsOfEncodeAccount = KwStruct.new(
409
+ :state_init,
410
+ :balance,
411
+ :last_trans_lt,
412
+ :last_paid,
413
+ :boc_cache
414
+ ) do
415
+ def to_h
416
+ {
417
+ state_init: state_init.to_h,
418
+ balance: balance,
419
+ last_trans_lt: last_trans_lt,
420
+ last_paid: last_paid,
421
+ boc_cache: boc_cache&.to_h
422
+ }
353
423
  end
354
424
  end
355
425
 
356
- ResultOfEncodeAccount = Struct.new(:account, :id_, keyword_init: true) do
426
+ ResultOfEncodeAccount = KwStruct.new(:account, :id_) do
357
427
  def initialize(account:, id_:)
358
428
  super
359
429
  end
@@ -621,7 +691,7 @@ module TonSdk
621
691
  end
622
692
  end
623
693
 
624
- ParamsOfEncodeInternalMessage = Struct.new(
694
+ ParamsOfEncodeInternalMessage = KwStruct.new(
625
695
  :abi,
626
696
  :address,
627
697
  :src_address,
@@ -629,8 +699,7 @@ module TonSdk
629
699
  :call_set,
630
700
  :value,
631
701
  :bounce,
632
- :enable_ihr,
633
- keyword_init: true
702
+ :enable_ihr
634
703
  ) do
635
704
  def initialize(
636
705
  abi: nil,
@@ -646,20 +715,82 @@ module TonSdk
646
715
  end
647
716
  end
648
717
 
649
- ResultOfEncodeInternalMessage = Struct.new(
718
+ ResultOfEncodeInternalMessage = KwStruct.new(
650
719
  :message,
651
720
  :address,
652
- :message_id,
653
- keyword_init: true
721
+ :message_id
654
722
  ) do
655
723
  def initialize(message:, address:, message_id:)
656
724
  super
657
725
  end
658
726
  end
659
727
 
660
- ParamsOfDecodeAccountData = Struct.new(:abi, :data, keyword_init: true)
661
- ResultOfDecodeData = Struct.new(:data)
728
+ ParamsOfDecodeAccountData = KwStruct.new(:abi, :data) do
729
+ def to_h
730
+ {
731
+ abi: abi&.to_h,
732
+ data: data
733
+ }
734
+ end
735
+ end
736
+
737
+ ResultOfDecodeAccountData = KwStruct.new(:data)
738
+
739
+ ParamsOfUpdateInitialData = KwStruct.new(
740
+ :data,
741
+ :abi,
742
+ :initial_data,
743
+ :initial_pubkey,
744
+ :boc_cache
745
+ ) do
746
+ def to_h
747
+ {
748
+ data: data,
749
+ abi: abi&.to_h,
750
+ initial_data: initial_data,
751
+ initial_pubkey: initial_pubkey,
752
+ boc_cache: boc_cache&.to_h
753
+ }
754
+ end
755
+ end
756
+
757
+ ResultOfUpdateInitialData = KwStruct.new(:data)
662
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
+
772
+ ParamsOfDecodeInitialData = KwStruct.new(:data, :abi) do
773
+ def to_h
774
+ {
775
+ data: data,
776
+ abi: abi&.to_h
777
+ }
778
+ end
779
+ end
780
+
781
+ ResultOfDecodeInitialData = KwStruct.new(:initial_pubkey, :initial_data)
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)
663
794
 
664
795
  #
665
796
  # functions
@@ -668,7 +799,7 @@ module TonSdk
668
799
  def self.encode_message_body(ctx, params)
669
800
  Interop::request_to_native_lib(ctx, "abi.encode_message_body", params) do |resp|
670
801
  if resp.success?
671
- yield NativeLibResponsetResult.new(
802
+ yield NativeLibResponseResult.new(
672
803
  result: ResultOfEncodeMessageBody.new(
673
804
  body: resp.result["body"],
674
805
  data_to_sign: resp.result["data_to_sign"])
@@ -682,8 +813,8 @@ module TonSdk
682
813
  def self.attach_signature_to_message_body(ctx, params)
683
814
  Interop::request_to_native_lib(ctx, "abi.attach_signature_to_message_body", params) do |resp|
684
815
  if resp.success?
685
- yield NativeLibResponsetResult.new(
686
- result: ResultOfAttachSignatureToMessageBody.new(resp.result["body"])
816
+ yield NativeLibResponseResult.new(
817
+ result: ResultOfAttachSignatureToMessageBody.new(body: resp.result["body"])
687
818
  )
688
819
  else
689
820
  yield resp
@@ -694,7 +825,7 @@ module TonSdk
694
825
  def self.encode_message(ctx, params)
695
826
  Interop::request_to_native_lib(ctx, "abi.encode_message", params) do |resp|
696
827
  if resp.success?
697
- yield NativeLibResponsetResult.new(
828
+ yield NativeLibResponseResult.new(
698
829
  result: ResultOfEncodeMessage.new(
699
830
  message: resp.result["message"],
700
831
  data_to_sign: resp.result["data_to_sign"],
@@ -711,7 +842,7 @@ module TonSdk
711
842
  def self.attach_signature(ctx, params)
712
843
  Interop::request_to_native_lib(ctx, "abi.attach_signature", params) do |resp|
713
844
  if resp.success?
714
- yield NativeLibResponsetResult.new(
845
+ yield NativeLibResponseResult.new(
715
846
  result: ResultOfAttachSignature.new(
716
847
  message: resp.result["message"],
717
848
  message_id: resp.result["message_id"])
@@ -725,7 +856,7 @@ module TonSdk
725
856
  def self.decode_message(ctx, params)
726
857
  Interop::request_to_native_lib(ctx, "abi.decode_message", params) do |resp|
727
858
  if resp.success?
728
- yield NativeLibResponsetResult.new(
859
+ yield NativeLibResponseResult.new(
729
860
  result: DecodedMessageBody.from_json(resp.result)
730
861
  )
731
862
  else
@@ -737,7 +868,7 @@ module TonSdk
737
868
  def self.decode_message_body(ctx, params)
738
869
  Interop::request_to_native_lib(ctx, "abi.decode_message_body", params) do |resp|
739
870
  if resp.success?
740
- yield NativeLibResponsetResult.new(
871
+ yield NativeLibResponseResult.new(
741
872
  result: DecodedMessageBody.from_json(resp.result)
742
873
  )
743
874
  else
@@ -749,7 +880,7 @@ module TonSdk
749
880
  def self.encode_account(ctx, params)
750
881
  Interop::request_to_native_lib(ctx, "abi.encode_account", params) do |resp|
751
882
  if resp.success?
752
- yield NativeLibResponsetResult.new(
883
+ yield NativeLibResponseResult.new(
753
884
  result: ResultOfEncodeAccount.new(
754
885
  account: resp.result["account"],
755
886
  id_: resp.result["id"]
@@ -764,7 +895,7 @@ module TonSdk
764
895
  def self.encode_internal_message(ctx, params)
765
896
  Interop::request_to_native_lib(ctx, "abi.encode_internal_message", params) do |resp|
766
897
  if resp.success?
767
- yield NativeLibResponsetResult.new(
898
+ yield NativeLibResponseResult.new(
768
899
  result: ResultOfEncodeInternalMessage.new(
769
900
  message: resp.result["message"],
770
901
  address: resp.result["address"],
@@ -780,9 +911,23 @@ module TonSdk
780
911
  def self.decode_account_data(ctx, params)
781
912
  Interop::request_to_native_lib(ctx, "abi.decode_account_data", params) do |resp|
782
913
  if resp.success?
783
- yield NativeLibResponsetResult.new(
784
- result: ResultOfDecodeData.new(
785
- resp.result["data"]
914
+ yield NativeLibResponseResult.new(
915
+ result: ResultOfDecodeAccountData.new(
916
+ data: resp.result["data"]
917
+ )
918
+ )
919
+ else
920
+ yield resp
921
+ end
922
+ end
923
+ end
924
+
925
+ def self.update_initial_data(ctx, params)
926
+ Interop::request_to_native_lib(ctx, "abi.update_initial_data", params) do |resp|
927
+ if resp.success?
928
+ yield NativeLibResponseResult.new(
929
+ result: ResultOfUpdateInitialData.new(
930
+ data: resp.result["data"]
786
931
  )
787
932
  )
788
933
  else
@@ -791,7 +936,47 @@ module TonSdk
791
936
  end
792
937
  end
793
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
794
952
 
953
+ def self.decode_initial_data(ctx, params)
954
+ Interop::request_to_native_lib(ctx, "abi.decode_initial_data", params) do |resp|
955
+ if resp.success?
956
+ yield NativeLibResponseResult.new(
957
+ result: ResultOfDecodeInitialData.new(
958
+ initial_pubkey: resp.result["initial_pubkey"],
959
+ initial_data: resp.result["initial_data"]
960
+ )
961
+ )
962
+ else
963
+ yield resp
964
+ end
965
+ end
966
+ end
795
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
796
981
  end
797
- end
982
+ end