everscale-client-ruby 1.1.53 → 1.1.60

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,128 +17,218 @@ module TonClient
17
17
  # boc: String - # # BOC encoded as base64
18
18
  # RESPONSE: ResultOfParse
19
19
  # parsed: Value - # # JSON containing parsed BOC
20
+ # Async
20
21
  def parse_message(payload, &block)
21
22
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
22
23
  end
23
24
 
25
+ # Sync
26
+ def parse_message_sync(payload)
27
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
28
+ end
29
+
24
30
  # INPUT: ParamsOfParse
25
31
  # boc: String - # # BOC encoded as base64
26
32
  # RESPONSE: ResultOfParse
27
33
  # parsed: Value - # # JSON containing parsed BOC
34
+ # Async
28
35
  def parse_transaction(payload, &block)
29
36
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
30
37
  end
31
38
 
39
+ # Sync
40
+ def parse_transaction_sync(payload)
41
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
42
+ end
43
+
32
44
  # INPUT: ParamsOfParse
33
45
  # boc: String - # # BOC encoded as base64
34
46
  # RESPONSE: ResultOfParse
35
47
  # parsed: Value - # # JSON containing parsed BOC
48
+ # Async
36
49
  def parse_account(payload, &block)
37
50
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
38
51
  end
39
52
 
53
+ # Sync
54
+ def parse_account_sync(payload)
55
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
56
+ end
57
+
40
58
  # INPUT: ParamsOfParse
41
59
  # boc: String - # # BOC encoded as base64
42
60
  # RESPONSE: ResultOfParse
43
61
  # parsed: Value - # # JSON containing parsed BOC
62
+ # Async
44
63
  def parse_block(payload, &block)
45
64
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
46
65
  end
47
66
 
67
+ # Sync
68
+ def parse_block_sync(payload)
69
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
70
+ end
71
+
48
72
  # INPUT: ParamsOfParseShardstate
49
73
  # boc: String - # # BOC encoded as base64
50
74
  # id: String - # # Shardstate identificator
51
75
  # workchain_id: Number - # # Workchain shardstate belongs to
52
76
  # RESPONSE: ResultOfParse
53
77
  # parsed: Value - # # JSON containing parsed BOC
78
+ # Async
54
79
  def parse_shardstate(payload, &block)
55
80
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
56
81
  end
57
82
 
83
+ # Sync
84
+ def parse_shardstate_sync(payload)
85
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
86
+ end
87
+
58
88
  # INPUT: ParamsOfGetBlockchainConfig
59
89
  # block_boc: String - # # Key block BOC or zerostate BOC encoded as base64
60
90
  # RESPONSE: ResultOfGetBlockchainConfig
61
91
  # config_boc: String - # # Blockchain config BOC encoded as base64
92
+ # Async
62
93
  def get_blockchain_config(payload, &block)
63
94
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
64
95
  end
65
96
 
97
+ # Sync
98
+ def get_blockchain_config_sync(payload)
99
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
100
+ end
101
+
66
102
  # INPUT: ParamsOfGetBocHash
67
103
  # boc: String - # # BOC encoded as base64 or BOC handle
68
104
  # RESPONSE: ResultOfGetBocHash
69
105
  # hash: String - # # BOC root hash encoded with hex
106
+ # Async
70
107
  def get_boc_hash(payload, &block)
71
108
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
72
109
  end
73
110
 
111
+ # Sync
112
+ def get_boc_hash_sync(payload)
113
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
114
+ end
115
+
74
116
  # INPUT: ParamsOfGetBocDepth
75
117
  # boc: String - # # BOC encoded as base64 or BOC handle
76
118
  # RESPONSE: ResultOfGetBocDepth
77
119
  # depth: Number - # # BOC root cell depth
120
+ # Async
78
121
  def get_boc_depth(payload, &block)
79
122
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
80
123
  end
81
124
 
125
+ # Sync
126
+ def get_boc_depth_sync(payload)
127
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
128
+ end
129
+
82
130
  # INPUT: ParamsOfGetCodeFromTvc
83
131
  # tvc: String - # # Contract TVC image or image BOC handle
84
132
  # RESPONSE: ResultOfGetCodeFromTvc
85
133
  # code: String - # # Contract code encoded as base64
134
+ # Async
86
135
  def get_code_from_tvc(payload, &block)
87
136
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
88
137
  end
89
138
 
139
+ # Sync
140
+ def get_code_from_tvc_sync(payload)
141
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
142
+ end
143
+
90
144
  # INPUT: ParamsOfBocCacheGet
91
145
  # boc_ref: String - # # Reference to the cached BOC
92
146
  # RESPONSE: ResultOfBocCacheGet
93
147
  # boc: String<Optional> - # # BOC encoded as base64.
148
+ # Async
94
149
  def cache_get(payload, &block)
95
150
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
96
151
  end
97
152
 
153
+ # Sync
154
+ def cache_get_sync(payload)
155
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
156
+ end
157
+
98
158
  # INPUT: ParamsOfBocCacheSet
99
159
  # boc: String - # # BOC encoded as base64 or BOC reference
100
160
  # cache_type: BocCacheType - # # Cache type
101
161
  # RESPONSE: ResultOfBocCacheSet
102
162
  # boc_ref: String - # # Reference to the cached BOC
163
+ # Async
103
164
  def cache_set(payload, &block)
104
165
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
105
166
  end
106
167
 
168
+ # Sync
169
+ def cache_set_sync(payload)
170
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
171
+ end
172
+
107
173
  # INPUT: ParamsOfBocCacheUnpin
108
174
  # pin: String - # # Pinned name
109
175
  # boc_ref: String<Optional> - # # Reference to the cached BOC. # # If it is provided then only referenced BOC is unpinned
176
+ # Async
110
177
  def cache_unpin(payload, &block)
111
178
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
112
179
  end
113
180
 
181
+ # Sync
182
+ def cache_unpin_sync(payload)
183
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
184
+ end
185
+
114
186
  # INPUT: ParamsOfEncodeBoc
115
187
  # builder: Array - # # Cell builder operations.
116
188
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
117
189
  # RESPONSE: ResultOfEncodeBoc
118
190
  # boc: String - # # Encoded cell BOC or BOC cache key.
191
+ # Async
119
192
  def encode_boc(payload, &block)
120
193
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
121
194
  end
122
195
 
196
+ # Sync
197
+ def encode_boc_sync(payload)
198
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
199
+ end
200
+
123
201
  # INPUT: ParamsOfGetCodeSalt
124
202
  # code: String - # # Contract code BOC encoded as base64 or code BOC handle
125
203
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
126
204
  # RESPONSE: ResultOfGetCodeSalt
127
205
  # salt: String<Optional> - # # Contract code salt if present. # # BOC encoded as base64 or BOC handle
206
+ # Async
128
207
  def get_code_salt(payload, &block)
129
208
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
130
209
  end
131
210
 
211
+ # Sync
212
+ def get_code_salt_sync(payload)
213
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
214
+ end
215
+
132
216
  # INPUT: ParamsOfSetCodeSalt
133
217
  # code: String - # # Contract code BOC encoded as base64 or code BOC handle
134
218
  # salt: String - # # Code salt to set. # # BOC encoded as base64 or BOC handle
135
219
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
136
220
  # RESPONSE: ResultOfSetCodeSalt
137
221
  # code: String - # # Contract code with salt set. # # BOC encoded as base64 or BOC handle
222
+ # Async
138
223
  def set_code_salt(payload, &block)
139
224
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
140
225
  end
141
226
 
227
+ # Sync
228
+ def set_code_salt_sync(payload)
229
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
230
+ end
231
+
142
232
  # INPUT: ParamsOfDecodeTvc
143
233
  # tvc: String - # # Contract TVC image BOC encoded as base64 or BOC handle
144
234
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
@@ -154,10 +244,16 @@ module TonClient
154
244
  # tock: Boolean<Optional> - # # `special.tock` field. # # Specifies the contract ability to handle tock transactions
155
245
  # split_depth: Number<Optional> - # # Is present and non-zero only in instances of large smart contracts
156
246
  # compiler_version: String<Optional> - # # Compiler version, for example 'sol 0.49.0'
247
+ # Async
157
248
  def decode_tvc(payload, &block)
158
249
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
159
250
  end
160
251
 
252
+ # Sync
253
+ def decode_tvc_sync(payload)
254
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
255
+ end
256
+
161
257
  # INPUT: ParamsOfEncodeTvc
162
258
  # code: String<Optional> - # # Contract code BOC encoded as base64 or BOC handle
163
259
  # data: String<Optional> - # # Contract data BOC encoded as base64 or BOC handle
@@ -168,10 +264,16 @@ module TonClient
168
264
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
169
265
  # RESPONSE: ResultOfEncodeTvc
170
266
  # tvc: String - # # Contract TVC image BOC encoded as base64 or BOC handle of boc_cache parameter was specified
267
+ # Async
171
268
  def encode_tvc(payload, &block)
172
269
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
173
270
  end
174
271
 
272
+ # Sync
273
+ def encode_tvc_sync(payload)
274
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
275
+ end
276
+
175
277
  # INPUT: ParamsOfEncodeExternalInMessage
176
278
  # src: String<Optional> - # # Source address.
177
279
  # dst: String - # # Destination address.
@@ -181,18 +283,30 @@ module TonClient
181
283
  # RESPONSE: ResultOfEncodeExternalInMessage
182
284
  # message: String - # # Message BOC encoded with `base64`.
183
285
  # message_id: String - # # Message id.
286
+ # Async
184
287
  def encode_external_in_message(payload, &block)
185
288
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
186
289
  end
187
290
 
291
+ # Sync
292
+ def encode_external_in_message_sync(payload)
293
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
294
+ end
295
+
188
296
  # INPUT: ParamsOfGetCompilerVersion
189
297
  # code: String - # # Contract code BOC encoded as base64 or code BOC handle
190
298
  # RESPONSE: ResultOfGetCompilerVersion
191
299
  # version: String<Optional> - # # Compiler version, for example 'sol 0.49.0'
300
+ # Async
192
301
  def get_compiler_version(payload, &block)
193
302
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
194
303
  end
195
304
 
305
+ # Sync
306
+ def get_compiler_version_sync(payload)
307
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
308
+ end
309
+
196
310
  end
197
311
  end
198
312
 
@@ -14,7 +14,8 @@ module TonClient
14
14
  @monitor = Monitor.new
15
15
  config = TonBinding.make_string(context_config.to_json)
16
16
  context_ptr = TonBinding.tc_create_context(config)
17
- @context = TonBinding.read_string_to_hash(context_ptr)['result']
17
+ context_response = TonBinding.read_string_data_ref(context_ptr)
18
+ @context = TonBinding.read_string_to_hash(context_response)['result']
18
19
  ObjectSpace.define_finalizer(self, self.class.finalize(@context))
19
20
  end
20
21
 
@@ -64,16 +65,28 @@ module TonClient
64
65
 
65
66
  # RESPONSE: ResultOfGetApiReference
66
67
  # api: Value -
68
+ # Async
67
69
  def get_api_reference(&block)
68
70
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
69
71
  end
70
72
 
73
+ # Sync
74
+ def get_api_reference_sync()
75
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: {})
76
+ end
77
+
71
78
  # RESPONSE: ResultOfVersion
72
79
  # version: String - # # Core Library version
80
+ # Async
73
81
  def version(&block)
74
82
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
75
83
  end
76
84
 
85
+ # Sync
86
+ def version_sync()
87
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: {})
88
+ end
89
+
77
90
  # RESPONSE: ClientConfig
78
91
  # network: NetworkConfig<Optional> -
79
92
  # crypto: CryptoConfig<Optional> -
@@ -81,24 +94,42 @@ module TonClient
81
94
  # boc: BocConfig<Optional> -
82
95
  # proofs: ProofsConfig<Optional> -
83
96
  # local_storage_path: String<Optional> - # # For file based storage is a folder name where SDK will store its data. For browser based is a browser async storage key prefix. Default (recommended) value is "~/.tonclient" for native environments and ".tonclient" for web-browser.
97
+ # Async
84
98
  def config(&block)
85
99
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
86
100
  end
87
101
 
102
+ # Sync
103
+ def config_sync()
104
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: {})
105
+ end
106
+
88
107
  # RESPONSE: ResultOfBuildInfo
89
108
  # build_number: Number - # # Build number assigned to this build by the CI.
90
109
  # dependencies: Array - # # Fingerprint of the most important dependencies.
110
+ # Async
91
111
  def build_info(&block)
92
112
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
93
113
  end
94
114
 
115
+ # Sync
116
+ def build_info_sync()
117
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: {})
118
+ end
119
+
95
120
  # INPUT: ParamsOfResolveAppRequest
96
121
  # app_request_id: Number - # # Request ID received from SDK
97
122
  # result: AppRequestResult - # # Result of request processing
123
+ # Async
98
124
  def resolve_app_request(payload, &block)
99
125
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
100
126
  end
101
127
 
128
+ # Sync
129
+ def resolve_app_request_sync(payload)
130
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
131
+ end
132
+
102
133
  end
103
134
  end
104
135