ton-client-ruby 1.1.0 → 1.1.1

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: 7d9f09aaabae6ed86f5adc9a77082f2c94ad685437fb7457e490253086ca80b5
4
- data.tar.gz: 6e2e1b73de3671c362fbb0ebdb919e9fdc7b94fabe8302b46fc3159ba42100af
3
+ metadata.gz: f48e56cad94ca8cf4c0f79ee9671c726504feeff18d728b13bad65586176a427
4
+ data.tar.gz: 8c9253c5667e80453daaf438c2480d591cd1408e4ba61355a1618905e4facf6e
5
5
  SHA512:
6
- metadata.gz: 621cc074093d4de7603aa1135dc597681aaf72337f42bab12bb9e3692f58462f7eb7696e04b029945abda6c85dbc584bc8d72804d89882d1d98966a69a139acd
7
- data.tar.gz: 9cf4d820e210ab28a1a64dbf6474b954de1b35166c692321b648464b3258b88a033678382a222237814a93b206c0f5ce07734399e0bd72774ff5a1f207a856be
6
+ metadata.gz: 7b17a23b52184ae21f0003d10e6101bcc9a67ef40a2bd1a41a29174b03660433a1b540bb6ba0e360c4088c9c9e0400238289437aa6b5603e790aa66974d2fc8c
7
+ data.tar.gz: e09b737bb8fc17c883e9cd61b6184bbae84e74af57cfcb3258420f89e2e81cba132892e687db4ca0f1b82fd03f022ed14d93c5ca6eaad6e3302a5fd371adf36a
data/bin/ton-client-ruby CHANGED
@@ -5,15 +5,23 @@ require File.dirname(__FILE__) + '/../lib/code_generator/code_generator.rb'
5
5
 
6
6
  GEM_DIR = File.dirname(__FILE__) + '/..'
7
7
 
8
- if ARGV[0] == 'update'
9
- if !ARGV[1]
10
- puts ''
11
- puts ''
12
- p "PLEASE DOWNLOAD api.json from https://github.com/tonlabs/TON-SDK/blob/master/tools/api.json and pass as second parameter."
13
- p "Example: ton-client-ruby update ./api.json"
14
- puts ''
15
- return
8
+ if ARGV[0] == 'update' && ARGV[1] == nil
9
+ script_file_path = File.expand_path(File.dirname(__FILE__))
10
+ `cd #{script_file_path}/.. && curl https://raw.githubusercontent.com/tonlabs/TON-SDK/master/tools/api.json > api.json`
11
+ api_json_path = "#{script_file_path}/../api.json"
12
+ json = ''
13
+ if File.exists?(api_json_path)
14
+ json = File.read(api_json_path)
15
+ else
16
+ p "File #{api_json_path} is not exist"
17
+ exit 0
16
18
  end
19
+ converter = ApiConverter.new(json)
20
+ types = converter.convert
21
+ generator = CodeGenerator.new(types, GEM_DIR)
22
+ generator.generate_self_code
23
+ system(%{bash -lc 'ruby #{script_file_path}/../lib/code_generator/release.rb'})
24
+ elsif ARGV[0] == 'update'
17
25
  api_json_path = ARGV[1]
18
26
  json = ''
19
27
  if File.exists?(api_json_path)
@@ -26,8 +34,8 @@ if ARGV[0] == 'update'
26
34
  types = converter.convert
27
35
  generator = CodeGenerator.new(types, GEM_DIR)
28
36
  generator.generate_self_code
29
- elsif ARGV[0] == 'update' && ARGV[1] == nil
30
- p 'soon from github'
37
+ system(%{bash -lc 'ruby #{script_file_path}/../lib/code_generator/release.rb'})
38
+
31
39
  elsif ARGV[0] == 'setup'
32
40
  raise "\nPLEASE INSTALL RUST TO YOUR SYSTEM. \nTry this command: \ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" if `which rustc`.strip.empty?
33
41
  unless Dir.exist?("#{GEM_DIR}/TON-SDK")
@@ -1,5 +1,6 @@
1
1
  require 'json'
2
2
  require 'byebug'
3
+ require 'set'
3
4
  require File.dirname(__FILE__) + '/helpers.rb'
4
5
 
5
6
 
@@ -166,8 +166,14 @@ giver_amount=10000000000
166
166
 
167
167
  \n## Update\n\n
168
168
  ```\n
169
+ ton-client-ruby update\n
170
+ ```\n\n
171
+ or\n\n
172
+ ```\n
169
173
  curl https://raw.githubusercontent.com/tonlabs/TON-SDK/master/tools/api.json > api.json\n\n
170
- ton-client-ruby update api.json\n
174
+ ```\n\n
175
+ ```\n
176
+ ton-client-ruby update ./api.json\n
171
177
  ```\n
172
178
  }
173
179
  content = checkContent(content)
@@ -129,6 +129,15 @@ module TonClient
129
129
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
130
130
  end
131
131
 
132
+ # INPUT: ParamsOfDecodeAccountData
133
+ # abi: Value - # # Contract ABI
134
+ # data: String - # # Data BOC or BOC handle
135
+ # RESPONSE: ResultOfDecodeData
136
+ # data: Value - # # Decoded data as a JSON structure.
137
+ def decode_account_data(payload, &block)
138
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
139
+ end
140
+
132
141
  end
133
142
  end
134
143
 
@@ -119,7 +119,7 @@ module TonClient
119
119
 
120
120
  # INPUT: ParamsOfNaclSign
121
121
  # unsigned: String - # # Data that must be signed encoded in `base64`.
122
- # secret: String - # # Signer's secret key - unprefixed 0-padded to 64 symbols hex string
122
+ # secret: String - # # Signer's secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See `nacl_sign_keypair_from_secret_key`.
123
123
  # RESPONSE: ResultOfNaclSign
124
124
  # signed: String - # # Signed data, encoded in `base64`.
125
125
  def nacl_sign(payload, &block)
@@ -137,7 +137,7 @@ module TonClient
137
137
 
138
138
  # INPUT: ParamsOfNaclSign
139
139
  # unsigned: String - # # Data that must be signed encoded in `base64`.
140
- # secret: String - # # Signer's secret key - unprefixed 0-padded to 64 symbols hex string
140
+ # secret: String - # # Signer's secret key - unprefixed 0-padded to 128 symbols hex string (concatenation of 64 symbols secret and 64 symbols public keys). See `nacl_sign_keypair_from_secret_key`.
141
141
  # RESPONSE: ResultOfNaclSignDetached
142
142
  # signature: String - # # Signature encoded in `hex`.
143
143
  def nacl_sign_detached(payload, &block)
@@ -354,6 +354,52 @@ module TonClient
354
354
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
355
355
  end
356
356
 
357
+ # RESPONSE: RegisteredEncryptionBox
358
+ # handle: EncryptionBoxHandle - # # Handle of the encryption box
359
+ def register_encryption_box(&block)
360
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
361
+ end
362
+
363
+ # INPUT: RegisteredEncryptionBox
364
+ # handle: EncryptionBoxHandle - # # Handle of the encryption box
365
+ def remove_encryption_box(payload, &block)
366
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
367
+ end
368
+
369
+ # INPUT: ParamsOfEncryptionBoxGetInfo
370
+ # encryption_box: EncryptionBoxHandle - # # Encryption box handle
371
+ # RESPONSE: ResultOfEncryptionBoxGetInfo
372
+ # info: EncryptionBoxInfo - # # Encryption box information
373
+ def encryption_box_get_info(payload, &block)
374
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
375
+ end
376
+
377
+ # INPUT: ParamsOfEncryptionBoxEncrypt
378
+ # encryption_box: EncryptionBoxHandle - # # Encryption box handle
379
+ # data: String - # # Data to be encrypted, encoded in Base64
380
+ # RESPONSE: ResultOfEncryptionBoxEncrypt
381
+ # data: String - # # Encrypted data, encoded in Base64. # # Padded to cipher block size
382
+ def encryption_box_encrypt(payload, &block)
383
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
384
+ end
385
+
386
+ # INPUT: ParamsOfEncryptionBoxDecrypt
387
+ # encryption_box: EncryptionBoxHandle - # # Encryption box handle
388
+ # data: String - # # Data to be decrypted, encoded in Base64
389
+ # RESPONSE: ResultOfEncryptionBoxDecrypt
390
+ # data: String - # # Decrypted data, encoded in Base64.
391
+ def encryption_box_decrypt(payload, &block)
392
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
393
+ end
394
+
395
+ # INPUT: ParamsOfCreateEncryptionBox
396
+ # algorithm: EncryptionAlgorithm - # # Encryption algorithm specifier including cipher parameters (key, IV, etc)
397
+ # RESPONSE: RegisteredEncryptionBox
398
+ # handle: EncryptionBoxHandle - # # Handle of the encryption box
399
+ def create_encryption_box(payload, &block)
400
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
401
+ end
402
+
357
403
  end
358
404
  end
359
405
 
@@ -127,6 +127,8 @@ module TonClient
127
127
  # INPUT: ParamsOfQueryTransactionTree
128
128
  # in_msg: String - # # Input message id.
129
129
  # abi_registry: Array<Optional> - # # List of contract ABIs that will be used to decode message bodies. Library will try to decode each returned message body using any ABI from the registry.
130
+ # timeout: Number<Optional> - # # Timeout used to limit waiting time for the missing messages and transaction. # # If some of the following messages and transactions are missing yetThe maximum waiting time is regulated by this option.
131
+ # Default value is 60000 (1 min).
130
132
  # RESPONSE: ResultOfQueryTransactionTree
131
133
  # messages: Array - # # Messages.
132
134
  # transactions: Array - # # Transactions.
@@ -134,6 +136,93 @@ module TonClient
134
136
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
135
137
  end
136
138
 
139
+ # INPUT: ParamsOfCreateBlockIterator
140
+ # start_time: Number<Optional> - # # Starting time to iterate from. # # If the application specifies this parameter then the iterationincludes blocks with `gen_utime` >= `start_time`.
141
+ # Otherwise the iteration starts from zero state.
142
+ # Must be specified in seconds.
143
+ # end_time: Number<Optional> - # # Optional end time to iterate for. # # If the application specifies this parameter then the iterationincludes blocks with `gen_utime` < `end_time`.
144
+ # Otherwise the iteration never stops.
145
+ # Must be specified in seconds.
146
+ # shard_filter: Array<Optional> - # # Shard prefix filter. # # If the application specifies this parameter and it is not the empty arraythen the iteration will include items related to accounts that belongs tothe specified shard prefixes.
147
+ # Shard prefix must be represented as a string "workchain:prefix".
148
+ # Where `workchain` is a signed integer and the `prefix` if a hexadecimalrepresentation if the 64-bit unsigned integer with tagged shard prefix.
149
+ # For example: "0:3800000000000000".
150
+ # result: String<Optional> - # # Projection (result) string. # # List of the fields that must be returned for iterated items.
151
+ # This field is the same as the `result` parameter ofthe `query_collection` function.
152
+ # Note that iterated items can contains additional fields that arenot requested in the `result`.
153
+ # RESPONSE: RegisteredIterator
154
+ # handle: Number - # # Iterator handle. # # Must be removed using `remove_iterator`when it is no more needed for the application.
155
+ def create_block_iterator(payload, &block)
156
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
157
+ end
158
+
159
+ # INPUT: ParamsOfResumeBlockIterator
160
+ # resume_state: Value - # # Iterator state from which to resume. # # Same as value returned from `iterator_next`.
161
+ # RESPONSE: RegisteredIterator
162
+ # handle: Number - # # Iterator handle. # # Must be removed using `remove_iterator`when it is no more needed for the application.
163
+ def resume_block_iterator(payload, &block)
164
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
165
+ end
166
+
167
+ # INPUT: ParamsOfCreateTransactionIterator
168
+ # start_time: Number<Optional> - # # Starting time to iterate from. # # If the application specifies this parameter then the iterationincludes blocks with `gen_utime` >= `start_time`.
169
+ # Otherwise the iteration starts from zero state.
170
+ # Must be specified in seconds.
171
+ # end_time: Number<Optional> - # # Optional end time to iterate for. # # If the application specifies this parameter then the iterationincludes blocks with `gen_utime` < `end_time`.
172
+ # Otherwise the iteration never stops.
173
+ # Must be specified in seconds.
174
+ # shard_filter: Array<Optional> - # # Shard prefix filters. # # If the application specifies this parameter and it is not an empty arraythen the iteration will include items related to accounts that belongs tothe specified shard prefixes.
175
+ # Shard prefix must be represented as a string "workchain:prefix".
176
+ # Where `workchain` is a signed integer and the `prefix` if a hexadecimalrepresentation if the 64-bit unsigned integer with tagged shard prefix.
177
+ # For example: "0:3800000000000000".
178
+ # Account address conforms to the shard filter ifit belongs to the filter workchain and the first bits of address match tothe shard prefix. Only transactions with suitable account addresses are iterated.
179
+ # accounts_filter: Array<Optional> - # # Account address filter. # # Application can specify the list of accounts for whichit wants to iterate transactions.
180
+ # If this parameter is missing or an empty list then the library iteratestransactions for all accounts that pass the shard filter.
181
+ # Note that the library doesn't detect conflicts between the account filter and the shard filterif both are specified.
182
+ # So it is an application responsibility to specify the correct filter combination.
183
+ # result: String<Optional> - # # Projection (result) string. # # List of the fields that must be returned for iterated items.
184
+ # This field is the same as the `result` parameter ofthe `query_collection` function.
185
+ # Note that iterated items can contain additional fields that arenot requested in the `result`.
186
+ # include_transfers: Boolean<Optional> - # # Include `transfers` field in iterated transactions. # # If this parameter is `true` then each transaction contains field`transfers` with list of transfer. See more about this structure in function description.
187
+ # RESPONSE: RegisteredIterator
188
+ # handle: Number - # # Iterator handle. # # Must be removed using `remove_iterator`when it is no more needed for the application.
189
+ def create_transaction_iterator(payload, &block)
190
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
191
+ end
192
+
193
+ # INPUT: ParamsOfResumeTransactionIterator
194
+ # resume_state: Value - # # Iterator state from which to resume. # # Same as value returned from `iterator_next`.
195
+ # accounts_filter: Array<Optional> - # # Account address filter. # # Application can specify the list of accounts for whichit wants to iterate transactions.
196
+ # If this parameter is missing or an empty list then the library iteratestransactions for all accounts that passes the shard filter.
197
+ # Note that the library doesn't detect conflicts between the account filter and the shard filterif both are specified.
198
+ # So it is the application's responsibility to specify the correct filter combination.
199
+ # RESPONSE: RegisteredIterator
200
+ # handle: Number - # # Iterator handle. # # Must be removed using `remove_iterator`when it is no more needed for the application.
201
+ def resume_transaction_iterator(payload, &block)
202
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
203
+ end
204
+
205
+ # INPUT: ParamsOfIteratorNext
206
+ # iterator: Number - # # Iterator handle
207
+ # limit: Number<Optional> - # # Maximum count of the returned items. # # If value is missing or is less than 1 the library uses 1.
208
+ # return_resume_state: Boolean<Optional> - # # Indicates that function must return the iterator state that can be used for resuming iteration.
209
+ # RESPONSE: ResultOfIteratorNext
210
+ # items: Array - # # Next available items. # # Note that `iterator_next` can return an empty items and `has_more` equals to `true`.
211
+ # In this case the application have to continue iteration.
212
+ # Such situation can take place when there is no data yet butthe requested `end_time` is not reached.
213
+ # has_more: Boolean - # # Indicates that there are more available items in iterated range.
214
+ # resume_state: Value<Optional> - # # Optional iterator state that can be used for resuming iteration. # # This field is returned only if the `return_resume_state` parameteris specified.
215
+ # Note that `resume_state` corresponds to the iteration positionafter the returned items.
216
+ def iterator_next(payload, &block)
217
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
218
+ end
219
+
220
+ # INPUT: RegisteredIterator
221
+ # handle: Number - # # Iterator handle. # # Must be removed using `remove_iterator`when it is no more needed for the application.
222
+ def remove_iterator(payload, &block)
223
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
224
+ end
225
+
137
226
  end
138
227
  end
139
228
 
@@ -30,7 +30,9 @@ module TonClient
30
30
  # message: String - # # Message BOC. # # Encoded with `base64`.
31
31
  # shard_block_id: String - # # The last generated block id of the destination account shard before the message was sent. # # You must provide the same value as the `send_message` has returned.
32
32
  # send_events: Boolean - # # Flag that enables/disables intermediate events
33
- # sending_endpoints: Array<Optional> - # # The list of endpoints to which the message was sent. # # You must provide the same value as the `send_message` has returned.
33
+ # sending_endpoints: Array<Optional> - # # The list of endpoints to which the message was sent. # # Use this field to get more informative errors.
34
+ # Provide the same value as the `send_message` has returned.
35
+ # If the message was not delivered (expired), SDK will log the endpoint URLs, used for its sending.
34
36
  # RESPONSE: ResultOfProcessMessage
35
37
  # transaction: Value - # # Parsed transaction. # # In addition to the regular transaction fields there is a`boc` field encoded with `base64` which contains sourcetransaction BOC.
36
38
  # out_messages: Array - # # List of output messages' BOCs. # # Encoded as `base64`
@@ -20,6 +20,14 @@ module TonClient
20
20
  core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
21
21
  end
22
22
 
23
+ # INPUT: ParamsOfGetAddressType
24
+ # address: String - # # Account address in any TON format.
25
+ # RESPONSE: ResultOfGetAddressType
26
+ # address_type: AccountAddressType - # # Account address type.
27
+ def get_address_type(payload, &block)
28
+ core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
29
+ end
30
+
23
31
  # INPUT: ParamsOfCalcStorageFee
24
32
  # account: String -
25
33
  # period: Number -
@@ -1,3 +1,4 @@
1
1
  module TonClient
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
4
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ton-client-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - nerzh
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 2021-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: Gem Ton Client Ruby for all ruby projects
98
112
  email:
99
113
  - emptystamp@gmail.com
@@ -125,7 +139,7 @@ homepage: https://github.com/nerzh/ton-client-ruby
125
139
  licenses:
126
140
  - MIT
127
141
  metadata: {}
128
- post_install_message:
142
+ post_install_message:
129
143
  rdoc_options: []
130
144
  require_paths:
131
145
  - lib
@@ -141,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
155
  version: '0'
142
156
  requirements: []
143
157
  rubygems_version: 3.0.9
144
- signing_key:
158
+ signing_key:
145
159
  specification_version: 4
146
160
  summary: This is gem ton-client-ruby
147
161
  test_files: []