everscale-client-ruby 1.1.43 → 1.1.47

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,12 +3,11 @@ module TonClient
3
3
  class Crypto
4
4
  include CommonInstanceHelpers
5
5
 
6
- attr_reader :core, :context
6
+ attr_reader :context
7
7
  MODULE = self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
8
8
 
9
- def initialize(context: Context.new, core: TonClient::TonBinding)
9
+ def initialize(context: nil)
10
10
  @context = context
11
- @core = core
12
11
  end
13
12
 
14
13
  # INPUT: ParamsOfFactorize
@@ -16,7 +15,7 @@ module TonClient
16
15
  # RESPONSE: ResultOfFactorize
17
16
  # factors: Array - # # Two factors of composite or empty if composite can't be factorized.
18
17
  def factorize(payload, &block)
19
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
18
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
20
19
  end
21
20
 
22
21
  # INPUT: ParamsOfModularPower
@@ -26,7 +25,7 @@ module TonClient
26
25
  # RESPONSE: ResultOfModularPower
27
26
  # modular_power: String - # # Result of modular exponentiation
28
27
  def modular_power(payload, &block)
29
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
28
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
30
29
  end
31
30
 
32
31
  # INPUT: ParamsOfTonCrc16
@@ -34,7 +33,7 @@ module TonClient
34
33
  # RESPONSE: ResultOfTonCrc16
35
34
  # crc: Number - # # Calculated CRC for input data.
36
35
  def ton_crc16(payload, &block)
37
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
36
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
38
37
  end
39
38
 
40
39
  # INPUT: ParamsOfGenerateRandomBytes
@@ -42,7 +41,7 @@ module TonClient
42
41
  # RESPONSE: ResultOfGenerateRandomBytes
43
42
  # bytes: String - # # Generated bytes encoded in `base64`.
44
43
  def generate_random_bytes(payload, &block)
45
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
44
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
46
45
  end
47
46
 
48
47
  # INPUT: ParamsOfConvertPublicKeyToTonSafeFormat
@@ -50,14 +49,14 @@ module TonClient
50
49
  # RESPONSE: ResultOfConvertPublicKeyToTonSafeFormat
51
50
  # ton_public_key: String - # # Public key represented in TON safe format.
52
51
  def convert_public_key_to_ton_safe_format(payload, &block)
53
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
52
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
54
53
  end
55
54
 
56
55
  # RESPONSE: KeyPair
57
56
  # public: String - # # Public key - 64 symbols hex string
58
57
  # secret: String - # # Private key - u64 symbols hex string
59
58
  def generate_random_sign_keys(&block)
60
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
59
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
61
60
  end
62
61
 
63
62
  # INPUT: ParamsOfSign
@@ -67,7 +66,7 @@ module TonClient
67
66
  # signed: String - # # Signed data combined with signature encoded in `base64`.
68
67
  # signature: String - # # Signature encoded in `hex`.
69
68
  def sign(payload, &block)
70
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
69
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
71
70
  end
72
71
 
73
72
  # INPUT: ParamsOfVerifySignature
@@ -76,7 +75,7 @@ module TonClient
76
75
  # RESPONSE: ResultOfVerifySignature
77
76
  # unsigned: String - # # Unsigned data encoded in `base64`.
78
77
  def verify_signature(payload, &block)
79
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
78
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
80
79
  end
81
80
 
82
81
  # INPUT: ParamsOfHash
@@ -84,7 +83,7 @@ module TonClient
84
83
  # RESPONSE: ResultOfHash
85
84
  # hash: String - # # Hash of input `data`. # # Encoded with 'hex'.
86
85
  def sha256(payload, &block)
87
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
86
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
88
87
  end
89
88
 
90
89
  # INPUT: ParamsOfHash
@@ -92,7 +91,7 @@ module TonClient
92
91
  # RESPONSE: ResultOfHash
93
92
  # hash: String - # # Hash of input `data`. # # Encoded with 'hex'.
94
93
  def sha512(payload, &block)
95
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
94
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
96
95
  end
97
96
 
98
97
  # INPUT: ParamsOfScrypt
@@ -105,7 +104,7 @@ module TonClient
105
104
  # RESPONSE: ResultOfScrypt
106
105
  # key: String - # # Derived key. # # Encoded with `hex`.
107
106
  def scrypt(payload, &block)
108
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
107
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
109
108
  end
110
109
 
111
110
  # INPUT: ParamsOfNaclSignKeyPairFromSecret
@@ -114,7 +113,7 @@ module TonClient
114
113
  # public: String - # # Public key - 64 symbols hex string
115
114
  # secret: String - # # Private key - u64 symbols hex string
116
115
  def nacl_sign_keypair_from_secret_key(payload, &block)
117
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
116
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
118
117
  end
119
118
 
120
119
  # INPUT: ParamsOfNaclSign
@@ -123,7 +122,7 @@ module TonClient
123
122
  # RESPONSE: ResultOfNaclSign
124
123
  # signed: String - # # Signed data, encoded in `base64`.
125
124
  def nacl_sign(payload, &block)
126
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
125
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
127
126
  end
128
127
 
129
128
  # INPUT: ParamsOfNaclSignOpen
@@ -132,7 +131,7 @@ module TonClient
132
131
  # RESPONSE: ResultOfNaclSignOpen
133
132
  # unsigned: String - # # Unsigned data, encoded in `base64`.
134
133
  def nacl_sign_open(payload, &block)
135
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
134
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
136
135
  end
137
136
 
138
137
  # INPUT: ParamsOfNaclSign
@@ -141,7 +140,7 @@ module TonClient
141
140
  # RESPONSE: ResultOfNaclSignDetached
142
141
  # signature: String - # # Signature encoded in `hex`.
143
142
  def nacl_sign_detached(payload, &block)
144
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
143
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
145
144
  end
146
145
 
147
146
  # INPUT: ParamsOfNaclSignDetachedVerify
@@ -151,14 +150,14 @@ module TonClient
151
150
  # RESPONSE: ResultOfNaclSignDetachedVerify
152
151
  # succeeded: Boolean - # # `true` if verification succeeded or `false` if it failed
153
152
  def nacl_sign_detached_verify(payload, &block)
154
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
153
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
155
154
  end
156
155
 
157
156
  # RESPONSE: KeyPair
158
157
  # public: String - # # Public key - 64 symbols hex string
159
158
  # secret: String - # # Private key - u64 symbols hex string
160
159
  def nacl_box_keypair(&block)
161
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
160
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
162
161
  end
163
162
 
164
163
  # INPUT: ParamsOfNaclBoxKeyPairFromSecret
@@ -167,7 +166,7 @@ module TonClient
167
166
  # public: String - # # Public key - 64 symbols hex string
168
167
  # secret: String - # # Private key - u64 symbols hex string
169
168
  def nacl_box_keypair_from_secret_key(payload, &block)
170
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
169
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
171
170
  end
172
171
 
173
172
  # INPUT: ParamsOfNaclBox
@@ -178,7 +177,7 @@ module TonClient
178
177
  # RESPONSE: ResultOfNaclBox
179
178
  # encrypted: String - # # Encrypted data encoded in `base64`.
180
179
  def nacl_box(payload, &block)
181
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
180
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
182
181
  end
183
182
 
184
183
  # INPUT: ParamsOfNaclBoxOpen
@@ -189,7 +188,7 @@ module TonClient
189
188
  # RESPONSE: ResultOfNaclBoxOpen
190
189
  # decrypted: String - # # Decrypted data encoded in `base64`.
191
190
  def nacl_box_open(payload, &block)
192
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
191
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
193
192
  end
194
193
 
195
194
  # INPUT: ParamsOfNaclSecretBox
@@ -199,7 +198,7 @@ module TonClient
199
198
  # RESPONSE: ResultOfNaclBox
200
199
  # encrypted: String - # # Encrypted data encoded in `base64`.
201
200
  def nacl_secret_box(payload, &block)
202
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
201
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
203
202
  end
204
203
 
205
204
  # INPUT: ParamsOfNaclSecretBoxOpen
@@ -209,7 +208,7 @@ module TonClient
209
208
  # RESPONSE: ResultOfNaclBoxOpen
210
209
  # decrypted: String - # # Decrypted data encoded in `base64`.
211
210
  def nacl_secret_box_open(payload, &block)
212
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
211
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
213
212
  end
214
213
 
215
214
  # INPUT: ParamsOfMnemonicWords
@@ -217,7 +216,7 @@ module TonClient
217
216
  # RESPONSE: ResultOfMnemonicWords
218
217
  # words: String - # # The list of mnemonic words
219
218
  def mnemonic_words(payload, &block)
220
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
219
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
221
220
  end
222
221
 
223
222
  # INPUT: ParamsOfMnemonicFromRandom
@@ -226,7 +225,7 @@ module TonClient
226
225
  # RESPONSE: ResultOfMnemonicFromRandom
227
226
  # phrase: String - # # String of mnemonic words
228
227
  def mnemonic_from_random(payload, &block)
229
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
228
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
230
229
  end
231
230
 
232
231
  # INPUT: ParamsOfMnemonicFromEntropy
@@ -236,7 +235,7 @@ module TonClient
236
235
  # RESPONSE: ResultOfMnemonicFromEntropy
237
236
  # phrase: String - # # Phrase
238
237
  def mnemonic_from_entropy(payload, &block)
239
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
238
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
240
239
  end
241
240
 
242
241
  # INPUT: ParamsOfMnemonicVerify
@@ -246,7 +245,7 @@ module TonClient
246
245
  # RESPONSE: ResultOfMnemonicVerify
247
246
  # valid: Boolean - # # Flag indicating if the mnemonic is valid or not
248
247
  def mnemonic_verify(payload, &block)
249
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
248
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
250
249
  end
251
250
 
252
251
  # INPUT: ParamsOfMnemonicDeriveSignKeys
@@ -258,7 +257,7 @@ module TonClient
258
257
  # public: String - # # Public key - 64 symbols hex string
259
258
  # secret: String - # # Private key - u64 symbols hex string
260
259
  def mnemonic_derive_sign_keys(payload, &block)
261
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
260
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
262
261
  end
263
262
 
264
263
  # INPUT: ParamsOfHDKeyXPrvFromMnemonic
@@ -268,7 +267,7 @@ module TonClient
268
267
  # RESPONSE: ResultOfHDKeyXPrvFromMnemonic
269
268
  # xprv: String - # # Serialized extended master private key
270
269
  def hdkey_xprv_from_mnemonic(payload, &block)
271
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
270
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
272
271
  end
273
272
 
274
273
  # INPUT: ParamsOfHDKeyDeriveFromXPrv
@@ -278,7 +277,7 @@ module TonClient
278
277
  # RESPONSE: ResultOfHDKeyDeriveFromXPrv
279
278
  # xprv: String - # # Serialized extended private key
280
279
  def hdkey_derive_from_xprv(payload, &block)
281
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
280
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
282
281
  end
283
282
 
284
283
  # INPUT: ParamsOfHDKeyDeriveFromXPrvPath
@@ -287,7 +286,7 @@ module TonClient
287
286
  # RESPONSE: ResultOfHDKeyDeriveFromXPrvPath
288
287
  # xprv: String - # # Derived serialized extended private key
289
288
  def hdkey_derive_from_xprv_path(payload, &block)
290
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
289
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
291
290
  end
292
291
 
293
292
  # INPUT: ParamsOfHDKeySecretFromXPrv
@@ -295,7 +294,7 @@ module TonClient
295
294
  # RESPONSE: ResultOfHDKeySecretFromXPrv
296
295
  # secret: String - # # Private key - 64 symbols hex string
297
296
  def hdkey_secret_from_xprv(payload, &block)
298
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
297
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
299
298
  end
300
299
 
301
300
  # INPUT: ParamsOfHDKeyPublicFromXPrv
@@ -303,7 +302,7 @@ module TonClient
303
302
  # RESPONSE: ResultOfHDKeyPublicFromXPrv
304
303
  # public: String - # # Public key - 64 symbols hex string
305
304
  def hdkey_public_from_xprv(payload, &block)
306
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
305
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
307
306
  end
308
307
 
309
308
  # INPUT: ParamsOfChaCha20
@@ -313,7 +312,7 @@ module TonClient
313
312
  # RESPONSE: ResultOfChaCha20
314
313
  # data: String - # # Encrypted/decrypted data. # # Encoded with `base64`.
315
314
  def chacha20(payload, &block)
316
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
315
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
317
316
  end
318
317
 
319
318
  # INPUT: ParamsOfCreateCryptoBox
@@ -322,13 +321,13 @@ module TonClient
322
321
  # RESPONSE: RegisteredCryptoBox
323
322
  # handle: CryptoBoxHandle -
324
323
  def create_crypto_box(payload, &block)
325
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
324
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
326
325
  end
327
326
 
328
327
  # INPUT: RegisteredCryptoBox
329
328
  # handle: CryptoBoxHandle -
330
329
  def remove_crypto_box(payload, &block)
331
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
330
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
332
331
  end
333
332
 
334
333
  # INPUT: RegisteredCryptoBox
@@ -336,7 +335,7 @@ module TonClient
336
335
  # RESPONSE: ResultOfGetCryptoBoxInfo
337
336
  # encrypted_secret: String - # # Secret (seed phrase) encrypted with salt and password.
338
337
  def get_crypto_box_info(payload, &block)
339
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
338
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
340
339
  end
341
340
 
342
341
  # INPUT: RegisteredCryptoBox
@@ -346,7 +345,7 @@ module TonClient
346
345
  # dictionary: MnemonicDictionary -
347
346
  # wordcount: Number -
348
347
  def get_crypto_box_seed_phrase(payload, &block)
349
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
348
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
350
349
  end
351
350
 
352
351
  # INPUT: ParamsOfGetSigningBoxFromCryptoBox
@@ -356,7 +355,7 @@ module TonClient
356
355
  # RESPONSE: RegisteredSigningBox
357
356
  # handle: SigningBoxHandle - # # Handle of the signing box.
358
357
  def get_signing_box_from_crypto_box(payload, &block)
359
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
358
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
360
359
  end
361
360
 
362
361
  # INPUT: ParamsOfGetEncryptionBoxFromCryptoBox
@@ -367,19 +366,19 @@ module TonClient
367
366
  # RESPONSE: RegisteredEncryptionBox
368
367
  # handle: EncryptionBoxHandle - # # Handle of the encryption box.
369
368
  def get_encryption_box_from_crypto_box(payload, &block)
370
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
369
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
371
370
  end
372
371
 
373
372
  # INPUT: RegisteredCryptoBox
374
373
  # handle: CryptoBoxHandle -
375
374
  def clear_crypto_box_secret_cache(payload, &block)
376
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
375
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
377
376
  end
378
377
 
379
378
  # RESPONSE: RegisteredSigningBox
380
379
  # handle: SigningBoxHandle - # # Handle of the signing box.
381
380
  def register_signing_box(&block)
382
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
381
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
383
382
  end
384
383
 
385
384
  # INPUT: KeyPair
@@ -388,7 +387,7 @@ module TonClient
388
387
  # RESPONSE: RegisteredSigningBox
389
388
  # handle: SigningBoxHandle - # # Handle of the signing box.
390
389
  def get_signing_box(payload, &block)
391
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
390
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
392
391
  end
393
392
 
394
393
  # INPUT: RegisteredSigningBox
@@ -396,7 +395,7 @@ module TonClient
396
395
  # RESPONSE: ResultOfSigningBoxGetPublicKey
397
396
  # pubkey: String - # # Public key of signing box. # # Encoded with hex
398
397
  def signing_box_get_public_key(payload, &block)
399
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
398
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
400
399
  end
401
400
 
402
401
  # INPUT: ParamsOfSigningBoxSign
@@ -405,25 +404,25 @@ module TonClient
405
404
  # RESPONSE: ResultOfSigningBoxSign
406
405
  # signature: String - # # Data signature. # # Encoded with `hex`.
407
406
  def signing_box_sign(payload, &block)
408
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
407
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
409
408
  end
410
409
 
411
410
  # INPUT: RegisteredSigningBox
412
411
  # handle: SigningBoxHandle - # # Handle of the signing box.
413
412
  def remove_signing_box(payload, &block)
414
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
413
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
415
414
  end
416
415
 
417
416
  # RESPONSE: RegisteredEncryptionBox
418
417
  # handle: EncryptionBoxHandle - # # Handle of the encryption box.
419
418
  def register_encryption_box(&block)
420
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
419
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: {}, &block)
421
420
  end
422
421
 
423
422
  # INPUT: RegisteredEncryptionBox
424
423
  # handle: EncryptionBoxHandle - # # Handle of the encryption box.
425
424
  def remove_encryption_box(payload, &block)
426
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
425
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
427
426
  end
428
427
 
429
428
  # INPUT: ParamsOfEncryptionBoxGetInfo
@@ -431,7 +430,7 @@ module TonClient
431
430
  # RESPONSE: ResultOfEncryptionBoxGetInfo
432
431
  # info: EncryptionBoxInfo - # # Encryption box information
433
432
  def encryption_box_get_info(payload, &block)
434
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
433
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
435
434
  end
436
435
 
437
436
  # INPUT: ParamsOfEncryptionBoxEncrypt
@@ -440,7 +439,7 @@ module TonClient
440
439
  # RESPONSE: ResultOfEncryptionBoxEncrypt
441
440
  # data: String - # # Encrypted data, encoded in Base64. # # Padded to cipher block size
442
441
  def encryption_box_encrypt(payload, &block)
443
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
442
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
444
443
  end
445
444
 
446
445
  # INPUT: ParamsOfEncryptionBoxDecrypt
@@ -449,7 +448,7 @@ module TonClient
449
448
  # RESPONSE: ResultOfEncryptionBoxDecrypt
450
449
  # data: String - # # Decrypted data, encoded in Base64.
451
450
  def encryption_box_decrypt(payload, &block)
452
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
451
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
453
452
  end
454
453
 
455
454
  # INPUT: ParamsOfCreateEncryptionBox
@@ -457,7 +456,7 @@ module TonClient
457
456
  # RESPONSE: RegisteredEncryptionBox
458
457
  # handle: EncryptionBoxHandle - # # Handle of the encryption box.
459
458
  def create_encryption_box(payload, &block)
460
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
459
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
461
460
  end
462
461
 
463
462
  end
@@ -3,12 +3,11 @@ module TonClient
3
3
  class Debot
4
4
  include CommonInstanceHelpers
5
5
 
6
- attr_reader :core, :context
6
+ attr_reader :context
7
7
  MODULE = self.to_s.downcase.gsub(/^(.+::|)(\w+)$/, '\2').freeze
8
8
 
9
- def initialize(context: Context.new, core: TonClient::TonBinding)
9
+ def initialize(context: nil)
10
10
  @context = context
11
- @core = core
12
11
  end
13
12
 
14
13
  # INPUT: ParamsOfInit
@@ -18,13 +17,13 @@ module TonClient
18
17
  # debot_abi: String - # # Debot abi as json string.
19
18
  # info: DebotInfo - # # Debot metadata.
20
19
  def init(payload, &block)
21
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
20
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
22
21
  end
23
22
 
24
23
  # INPUT: ParamsOfStart
25
24
  # debot_handle: DebotHandle - # # Debot handle which references an instance of debot engine.
26
25
  def start(payload, &block)
27
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
26
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
28
27
  end
29
28
 
30
29
  # INPUT: ParamsOfFetch
@@ -32,27 +31,27 @@ module TonClient
32
31
  # RESPONSE: ResultOfFetch
33
32
  # info: DebotInfo - # # Debot metadata.
34
33
  def fetch(payload, &block)
35
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
34
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
36
35
  end
37
36
 
38
37
  # INPUT: ParamsOfExecute
39
38
  # debot_handle: DebotHandle - # # Debot handle which references an instance of debot engine.
40
39
  # action: DebotAction - # # Debot Action that must be executed.
41
40
  def execute(payload, &block)
42
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
41
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
43
42
  end
44
43
 
45
44
  # INPUT: ParamsOfSend
46
45
  # debot_handle: DebotHandle - # # Debot handle which references an instance of debot engine.
47
46
  # message: String - # # BOC of internal message to debot encoded in base64 format.
48
47
  def send(payload, &block)
49
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
48
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
50
49
  end
51
50
 
52
51
  # INPUT: ParamsOfRemove
53
52
  # debot_handle: DebotHandle - # # Debot handle which references an instance of debot engine.
54
53
  def remove(payload, &block)
55
- core.requestLibrary(context: context.id, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
54
+ TonBinding.requestLibrary(context: context, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
56
55
  end
57
56
 
58
57
  end