ton-client-ruby 1.0.4 → 1.1.2
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/bin/ton-client-ruby +20 -10
- data/lib/code_generator/api_converter.rb +1 -0
- data/lib/code_generator/code_generator.rb +13 -0
- data/lib/ton-client-ruby/Client/Abi.rb +9 -0
- data/lib/ton-client-ruby/Client/Crypto.rb +48 -2
- data/lib/ton-client-ruby/Client/Net.rb +106 -0
- data/lib/ton-client-ruby/Client/Processing.rb +3 -1
- data/lib/ton-client-ruby/Client/Utils.rb +8 -0
- data/lib/ton-client-ruby/Helpers/CommonHelpers.rb +27 -0
- data/lib/ton-client-ruby/version.rb +2 -1
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2de4f2a99d797766f6b036cfe9657970ef7c1470b6c38cd87e92c785d409a0dd
|
4
|
+
data.tar.gz: f63f98dc0c9c62653be745caf36e52463a57dcae7e9d0232a1cbea0a1067984b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd3ad34bde559fa7bd236998a13f8a3bbe80138356349e81ef8cdda745f5f0c4cb7832a1bababddc0a2ee7225186c43f719a48327c2787dde2caf3ab4dbb2f1
|
7
|
+
data.tar.gz: 9a6a23d12500df460e80ffdc25ae34afbbc71071c798655034cece62c1760b9b0eedd029cec6422e024412490cf70272e5519e1b6f99162ec26cb3390743ec49
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
30
|
-
|
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")
|
@@ -36,5 +44,7 @@ elsif ARGV[0] == 'setup'
|
|
36
44
|
system("cd #{GEM_DIR}/TON-SDK && git pull --ff-only")
|
37
45
|
system("cd #{GEM_DIR}/TON-SDK && cargo update")
|
38
46
|
system("cd #{GEM_DIR}/TON-SDK && cargo build --release")
|
47
|
+
puts ''
|
39
48
|
puts "PATH TO YOR DYNAMIC LIBRARY IS: #{GEM_DIR}/TON-SDK/target/release/libton_client.dylib"
|
49
|
+
puts ''
|
40
50
|
end
|
@@ -58,6 +58,7 @@ gem install ton-client-ruby
|
|
58
58
|
Install TON-SDK
|
59
59
|
```bash
|
60
60
|
ton-client-ruby setup
|
61
|
+
# result - path to dylib file for ton-client-ruby configuration
|
61
62
|
```
|
62
63
|
|
63
64
|
### Manual build FreeTON SDK
|
@@ -162,6 +163,18 @@ giver_amount=10000000000
|
|
162
163
|
**rspec spec/processing.rb**
|
163
164
|
**rspec spec/tvm.rb**
|
164
165
|
**rspec spec/utils.rb**
|
166
|
+
|
167
|
+
\n## Update\n\n
|
168
|
+
```\n
|
169
|
+
ton-client-ruby update\n
|
170
|
+
```\n\n
|
171
|
+
or\n\n
|
172
|
+
```\n
|
173
|
+
curl https://raw.githubusercontent.com/tonlabs/TON-SDK/master/tools/api.json > api.json\n\n
|
174
|
+
```\n\n
|
175
|
+
```\n
|
176
|
+
ton-client-ruby update ./api.json\n
|
177
|
+
```\n
|
165
178
|
}
|
166
179
|
content = checkContent(content)
|
167
180
|
if File.exists?(readmePath)
|
@@ -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
|
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
|
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
|
|
@@ -106,6 +106,13 @@ module TonClient
|
|
106
106
|
core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
107
107
|
end
|
108
108
|
|
109
|
+
# RESPONSE: ResultOfGetEndpoints
|
110
|
+
# query: String - # # Current query endpoint
|
111
|
+
# endpoints: Array - # # List of all endpoints used by client
|
112
|
+
def get_endpoints(&block)
|
113
|
+
core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
|
114
|
+
end
|
115
|
+
|
109
116
|
# INPUT: ParamsOfQueryCounterparties
|
110
117
|
# account: String - # # Account address
|
111
118
|
# result: String - # # Projection (result) string
|
@@ -117,6 +124,105 @@ module TonClient
|
|
117
124
|
core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
118
125
|
end
|
119
126
|
|
127
|
+
# INPUT: ParamsOfQueryTransactionTree
|
128
|
+
# in_msg: String - # # Input message id.
|
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).
|
132
|
+
# RESPONSE: ResultOfQueryTransactionTree
|
133
|
+
# messages: Array - # # Messages.
|
134
|
+
# transactions: Array - # # Transactions.
|
135
|
+
def query_transaction_tree(payload, &block)
|
136
|
+
core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
|
137
|
+
end
|
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
|
+
|
120
226
|
end
|
121
227
|
end
|
122
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. # #
|
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,4 +1,31 @@
|
|
1
1
|
|
2
|
+
module TonClient
|
3
|
+
|
4
|
+
def self.read_abi(path_to_file)
|
5
|
+
file = File.read(path_to_file)
|
6
|
+
JSON.parse(file)
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.read_tvc(path_to_file)
|
10
|
+
data = File.open(path_to_file).read
|
11
|
+
# Encode the puppy
|
12
|
+
encoded = Base64.encode64(data)
|
13
|
+
# Spit it out into one continous string
|
14
|
+
encoded.gsub(/\n/, '')
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.callLibraryMethodSync(method, *args)
|
18
|
+
responses = []
|
19
|
+
queue = Queue.new
|
20
|
+
method.call(*args) do |response|
|
21
|
+
responses << response
|
22
|
+
queue.push 1 if response.finished == true
|
23
|
+
end
|
24
|
+
queue.pop
|
25
|
+
yield(responses) if block_given?
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
2
29
|
module CommonClassHelpers
|
3
30
|
|
4
31
|
def class_attr_accessor(*names)
|
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.
|
4
|
+
version: 1.1.2
|
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-
|
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: []
|