ton_sdk_client 1.24.0 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -2
- data/README.md +1 -1
- data/lib/ton_sdk_client/abi.rb +66 -13
- data/lib/ton_sdk_client/boc.rb +18 -18
- data/lib/ton_sdk_client/client.rb +5 -4
- data/lib/ton_sdk_client/client_context.rb +1 -0
- data/lib/ton_sdk_client/crypto.rb +41 -41
- data/lib/ton_sdk_client/debot.rb +112 -111
- data/lib/ton_sdk_client/helper.rb +1 -1
- data/lib/ton_sdk_client/interop.rb +3 -3
- data/lib/ton_sdk_client/net.rb +25 -25
- data/lib/ton_sdk_client/processing.rb +28 -18
- data/lib/ton_sdk_client/proofs.rb +61 -0
- data/lib/ton_sdk_client/tvm.rb +3 -3
- data/lib/ton_sdk_client/types.rb +1 -1
- data/lib/ton_sdk_client/utils.rb +5 -5
- data/lib/ton_sdk_client/version.rb +2 -2
- metadata +3 -2
@@ -243,7 +243,7 @@ module TonSdk
|
|
243
243
|
def self.factorize(ctx, params)
|
244
244
|
Interop::request_to_native_lib(ctx, "crypto.factorize", params) do |resp|
|
245
245
|
if resp.success?
|
246
|
-
yield
|
246
|
+
yield NativeLibResponseResult.new(
|
247
247
|
result: ResultOfFactorize.new(factors: resp.result["factors"])
|
248
248
|
)
|
249
249
|
else
|
@@ -255,7 +255,7 @@ module TonSdk
|
|
255
255
|
def self.modular_power(ctx, params)
|
256
256
|
Interop::request_to_native_lib(ctx, "crypto.modular_power", params) do |resp|
|
257
257
|
if resp.success?
|
258
|
-
yield
|
258
|
+
yield NativeLibResponseResult.new(
|
259
259
|
result: ResultOfModularPower.new(modular_power: resp.result["modular_power"])
|
260
260
|
)
|
261
261
|
else
|
@@ -267,7 +267,7 @@ module TonSdk
|
|
267
267
|
def self.ton_crc16(ctx, params)
|
268
268
|
Interop::request_to_native_lib(ctx, "crypto.ton_crc16", params) do |resp|
|
269
269
|
if resp.success?
|
270
|
-
yield
|
270
|
+
yield NativeLibResponseResult.new(
|
271
271
|
result: ResultOfTonCrc16.new(crc: resp.result["crc"])
|
272
272
|
)
|
273
273
|
else
|
@@ -279,7 +279,7 @@ module TonSdk
|
|
279
279
|
def self.generate_random_bytes(ctx, params)
|
280
280
|
Interop::request_to_native_lib(ctx, "crypto.generate_random_bytes", params) do |resp|
|
281
281
|
if resp.success?
|
282
|
-
yield
|
282
|
+
yield NativeLibResponseResult.new(
|
283
283
|
result: ResultOfGenerateRandomBytes.new(bytes: resp.result["bytes"])
|
284
284
|
)
|
285
285
|
else
|
@@ -291,7 +291,7 @@ module TonSdk
|
|
291
291
|
def self.convert_public_key_to_ton_safe_format(ctx, params)
|
292
292
|
Interop::request_to_native_lib(ctx, "crypto.convert_public_key_to_ton_safe_format", params) do |resp|
|
293
293
|
if resp.success?
|
294
|
-
yield
|
294
|
+
yield NativeLibResponseResult.new(
|
295
295
|
result: ResultOfConvertPublicKeyToTonSafeFormat.new(ton_public_key: resp.result["ton_public_key"])
|
296
296
|
)
|
297
297
|
else
|
@@ -303,7 +303,7 @@ module TonSdk
|
|
303
303
|
def self.generate_random_sign_keys(ctx, is_single_thread_only: false)
|
304
304
|
Interop::request_to_native_lib(ctx, "crypto.generate_random_sign_keys", nil, is_single_thread_only: is_single_thread_only) do |resp|
|
305
305
|
if resp.success?
|
306
|
-
yield
|
306
|
+
yield NativeLibResponseResult.new(
|
307
307
|
result: KeyPair.new(
|
308
308
|
public_: resp.result["public"],
|
309
309
|
secret: resp.result["secret"]
|
@@ -318,7 +318,7 @@ module TonSdk
|
|
318
318
|
def self.sign(ctx, params)
|
319
319
|
Interop::request_to_native_lib(ctx, "crypto.sign", params) do |resp|
|
320
320
|
if resp.success?
|
321
|
-
yield
|
321
|
+
yield NativeLibResponseResult.new(
|
322
322
|
result: ResultOfSign.new(
|
323
323
|
signed: resp.result["signed"],
|
324
324
|
signature: resp.result["signature"]
|
@@ -333,7 +333,7 @@ module TonSdk
|
|
333
333
|
def self.verify_signature(ctx, params)
|
334
334
|
Interop::request_to_native_lib(ctx, "crypto.verify_signature", params) do |resp|
|
335
335
|
if resp.success?
|
336
|
-
yield
|
336
|
+
yield NativeLibResponseResult.new(
|
337
337
|
result: ResultOfVerifySignature.new(unsigned: resp.result["unsigned"])
|
338
338
|
)
|
339
339
|
else
|
@@ -345,7 +345,7 @@ module TonSdk
|
|
345
345
|
def self.sha256(ctx, params)
|
346
346
|
Interop::request_to_native_lib(ctx, "crypto.sha256", params) do |resp|
|
347
347
|
if resp.success?
|
348
|
-
yield
|
348
|
+
yield NativeLibResponseResult.new(
|
349
349
|
result: ResultOfHash.new(hash: resp.result["hash"])
|
350
350
|
)
|
351
351
|
else
|
@@ -357,7 +357,7 @@ module TonSdk
|
|
357
357
|
def self.sha512(ctx, params)
|
358
358
|
Interop::request_to_native_lib(ctx, "crypto.sha512", params) do |resp|
|
359
359
|
if resp.success?
|
360
|
-
yield
|
360
|
+
yield NativeLibResponseResult.new(
|
361
361
|
result: ResultOfHash.new(hash: resp.result["hash"])
|
362
362
|
)
|
363
363
|
else
|
@@ -369,7 +369,7 @@ module TonSdk
|
|
369
369
|
def self.scrypt(ctx, params)
|
370
370
|
Interop::request_to_native_lib(ctx, "crypto.scrypt", params) do |resp|
|
371
371
|
if resp.success?
|
372
|
-
yield
|
372
|
+
yield NativeLibResponseResult.new(
|
373
373
|
result: ResultOfScrypt.new(key: resp.result["key"])
|
374
374
|
)
|
375
375
|
else
|
@@ -381,7 +381,7 @@ module TonSdk
|
|
381
381
|
def self.nacl_sign_keypair_from_secret_key(ctx, params)
|
382
382
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign_keypair_from_secret_key", params) do |resp|
|
383
383
|
if resp.success?
|
384
|
-
yield
|
384
|
+
yield NativeLibResponseResult.new(
|
385
385
|
result: KeyPair.new(
|
386
386
|
public_: resp.result["public"],
|
387
387
|
secret: resp.result["secret"]
|
@@ -396,7 +396,7 @@ module TonSdk
|
|
396
396
|
def self.nacl_sign(ctx, params)
|
397
397
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign", params) do |resp|
|
398
398
|
if resp.success?
|
399
|
-
yield
|
399
|
+
yield NativeLibResponseResult.new(
|
400
400
|
result: ResultOfNaclSign.new(signed: resp.result["signed"])
|
401
401
|
)
|
402
402
|
else
|
@@ -408,7 +408,7 @@ module TonSdk
|
|
408
408
|
def self.nacl_sign_open(ctx, params)
|
409
409
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign_open", params) do |resp|
|
410
410
|
if resp.success?
|
411
|
-
yield
|
411
|
+
yield NativeLibResponseResult.new(
|
412
412
|
result: ResultOfNaclSignOpen.new(unsigned: resp.result["unsigned"])
|
413
413
|
)
|
414
414
|
else
|
@@ -420,7 +420,7 @@ module TonSdk
|
|
420
420
|
def self.nacl_sign_detached(ctx, params)
|
421
421
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign_detached", params) do |resp|
|
422
422
|
if resp.success?
|
423
|
-
yield
|
423
|
+
yield NativeLibResponseResult.new(
|
424
424
|
result: ResultOfNaclSignDetached.new(signature: resp.result["signature"])
|
425
425
|
)
|
426
426
|
else
|
@@ -432,7 +432,7 @@ module TonSdk
|
|
432
432
|
def self.nacl_sign_detached_verify(ctx, params)
|
433
433
|
Interop::request_to_native_lib(ctx, "crypto.nacl_sign_detached_verify", params) do |resp|
|
434
434
|
if resp.success?
|
435
|
-
yield
|
435
|
+
yield NativeLibResponseResult.new(
|
436
436
|
result: ResultOfNaclSignDetachedVerify.new(succeeded: resp.result["succeeded"])
|
437
437
|
)
|
438
438
|
else
|
@@ -444,7 +444,7 @@ module TonSdk
|
|
444
444
|
def self.nacl_box_keypair(ctx)
|
445
445
|
Interop::request_to_native_lib(ctx, "crypto.nacl_box_keypair") do |resp|
|
446
446
|
if resp.success?
|
447
|
-
yield
|
447
|
+
yield NativeLibResponseResult.new(
|
448
448
|
result: KeyPair.new(
|
449
449
|
public_: resp.result["public"],
|
450
450
|
secret: resp.result["secret"]
|
@@ -459,7 +459,7 @@ module TonSdk
|
|
459
459
|
def self.nacl_box_keypair_from_secret_key(ctx, params)
|
460
460
|
Interop::request_to_native_lib(ctx, "crypto.nacl_box_keypair_from_secret_key", params) do |resp|
|
461
461
|
if resp.success?
|
462
|
-
yield
|
462
|
+
yield NativeLibResponseResult.new(
|
463
463
|
result: KeyPair.new(
|
464
464
|
public_: resp.result["public"],
|
465
465
|
secret: resp.result["secret"]
|
@@ -474,7 +474,7 @@ module TonSdk
|
|
474
474
|
def self.nacl_box(ctx, params)
|
475
475
|
Interop::request_to_native_lib(ctx, "crypto.nacl_box", params) do |resp|
|
476
476
|
if resp.success?
|
477
|
-
yield
|
477
|
+
yield NativeLibResponseResult.new(
|
478
478
|
result: ResultOfNaclBox.new(encrypted: resp.result["encrypted"])
|
479
479
|
)
|
480
480
|
else
|
@@ -486,7 +486,7 @@ module TonSdk
|
|
486
486
|
def self.nacl_box_open(ctx, params)
|
487
487
|
Interop::request_to_native_lib(ctx, "crypto.nacl_box_open", params) do |resp|
|
488
488
|
if resp.success?
|
489
|
-
yield
|
489
|
+
yield NativeLibResponseResult.new(
|
490
490
|
result: ResultOfNaclBoxOpen.new(decrypted: resp.result["decrypted"])
|
491
491
|
)
|
492
492
|
else
|
@@ -498,7 +498,7 @@ module TonSdk
|
|
498
498
|
def self.nacl_secret_box(ctx, params)
|
499
499
|
Interop::request_to_native_lib(ctx, "crypto.nacl_secret_box", params) do |resp|
|
500
500
|
if resp.success?
|
501
|
-
yield
|
501
|
+
yield NativeLibResponseResult.new(
|
502
502
|
result: ResultOfNaclBox.new(encrypted: resp.result["encrypted"])
|
503
503
|
)
|
504
504
|
else
|
@@ -510,7 +510,7 @@ module TonSdk
|
|
510
510
|
def self.nacl_secret_box_open(ctx, params)
|
511
511
|
Interop::request_to_native_lib(ctx, "crypto.nacl_secret_box_open", params) do |resp|
|
512
512
|
if resp.success?
|
513
|
-
yield
|
513
|
+
yield NativeLibResponseResult.new(
|
514
514
|
result: ResultOfNaclBoxOpen.new(decrypted: resp.result["decrypted"])
|
515
515
|
)
|
516
516
|
else
|
@@ -522,7 +522,7 @@ module TonSdk
|
|
522
522
|
def self.mnemonic_words(ctx, params)
|
523
523
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_words", params) do |resp|
|
524
524
|
if resp.success?
|
525
|
-
yield
|
525
|
+
yield NativeLibResponseResult.new(
|
526
526
|
result: ResultOfMnemonicWords.new(words: resp.result["words"])
|
527
527
|
)
|
528
528
|
else
|
@@ -534,7 +534,7 @@ module TonSdk
|
|
534
534
|
def self.mnemonic_from_random(ctx, params)
|
535
535
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_from_random", params) do |resp|
|
536
536
|
if resp.success?
|
537
|
-
yield
|
537
|
+
yield NativeLibResponseResult.new(
|
538
538
|
result: ResultOfMnemonicFromRandom.new(phrase: resp.result["phrase"])
|
539
539
|
)
|
540
540
|
else
|
@@ -546,7 +546,7 @@ module TonSdk
|
|
546
546
|
def self.mnemonic_from_entropy(ctx, params)
|
547
547
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_from_entropy", params) do |resp|
|
548
548
|
if resp.success?
|
549
|
-
yield
|
549
|
+
yield NativeLibResponseResult.new(
|
550
550
|
result: ResultOfMnemonicFromEntropy.new(phrase: resp.result["phrase"])
|
551
551
|
)
|
552
552
|
else
|
@@ -558,7 +558,7 @@ module TonSdk
|
|
558
558
|
def self.mnemonic_verify(ctx, params)
|
559
559
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_verify", params) do |resp|
|
560
560
|
if resp.success?
|
561
|
-
yield
|
561
|
+
yield NativeLibResponseResult.new(
|
562
562
|
result: ResultOfMnemonicVerify.new(valid: resp.result["valid"])
|
563
563
|
)
|
564
564
|
else
|
@@ -570,7 +570,7 @@ module TonSdk
|
|
570
570
|
def self.mnemonic_derive_sign_keys(ctx, params)
|
571
571
|
Interop::request_to_native_lib(ctx, "crypto.mnemonic_derive_sign_keys", params) do |resp|
|
572
572
|
if resp.success?
|
573
|
-
yield
|
573
|
+
yield NativeLibResponseResult.new(
|
574
574
|
result: KeyPair.new(
|
575
575
|
public_: resp.result["public"],
|
576
576
|
secret: resp.result["secret"]
|
@@ -585,7 +585,7 @@ module TonSdk
|
|
585
585
|
def self.hdkey_xprv_from_mnemonic(ctx, params)
|
586
586
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_xprv_from_mnemonic", params) do |resp|
|
587
587
|
if resp.success?
|
588
|
-
yield
|
588
|
+
yield NativeLibResponseResult.new(
|
589
589
|
result: ResultOfHDKeyXPrvFromMnemonic.new(xprv: resp.result["xprv"])
|
590
590
|
)
|
591
591
|
else
|
@@ -597,7 +597,7 @@ module TonSdk
|
|
597
597
|
def self.hdkey_derive_from_xprv(ctx, params)
|
598
598
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_derive_from_xprv", params) do |resp|
|
599
599
|
if resp.success?
|
600
|
-
yield
|
600
|
+
yield NativeLibResponseResult.new(
|
601
601
|
result: ResultOfHDKeyDeriveFromXPrv.new(xprv: resp.result["xprv"])
|
602
602
|
)
|
603
603
|
else
|
@@ -609,7 +609,7 @@ module TonSdk
|
|
609
609
|
def self.hdkey_derive_from_xprv_path(ctx, params)
|
610
610
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_derive_from_xprv_path", params) do |resp|
|
611
611
|
if resp.success?
|
612
|
-
yield
|
612
|
+
yield NativeLibResponseResult.new(
|
613
613
|
result: ResultOfHDKeyDeriveFromXPrvPath.new(xprv: resp.result["xprv"])
|
614
614
|
)
|
615
615
|
else
|
@@ -621,7 +621,7 @@ module TonSdk
|
|
621
621
|
def self.hdkey_secret_from_xprv(ctx, params)
|
622
622
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_secret_from_xprv", params) do |resp|
|
623
623
|
if resp.success?
|
624
|
-
yield
|
624
|
+
yield NativeLibResponseResult.new(
|
625
625
|
result: ResultOfHDKeySecretFromXPrv.new(secret: resp.result["secret"])
|
626
626
|
)
|
627
627
|
else
|
@@ -633,7 +633,7 @@ module TonSdk
|
|
633
633
|
def self.hdkey_public_from_xprv(ctx, params)
|
634
634
|
Interop::request_to_native_lib(ctx, "crypto.hdkey_public_from_xprv", params) do |resp|
|
635
635
|
if resp.success?
|
636
|
-
yield
|
636
|
+
yield NativeLibResponseResult.new(
|
637
637
|
result: ResultOfHDKeyPublicFromXPrv.new(public_: resp.result["public"])
|
638
638
|
)
|
639
639
|
else
|
@@ -645,7 +645,7 @@ module TonSdk
|
|
645
645
|
def self.chacha20(ctx, params)
|
646
646
|
Interop::request_to_native_lib(ctx, "crypto.chacha20", params) do |resp|
|
647
647
|
if resp.success?
|
648
|
-
yield
|
648
|
+
yield NativeLibResponseResult.new(
|
649
649
|
result: ResultOfChaCha20.new(data: resp.result["data"])
|
650
650
|
)
|
651
651
|
else
|
@@ -684,7 +684,7 @@ module TonSdk
|
|
684
684
|
is_single_thread_only: is_single_thread_only
|
685
685
|
) do |resp|
|
686
686
|
if resp.success?
|
687
|
-
yield
|
687
|
+
yield NativeLibResponseResult.new(
|
688
688
|
result: RegisteredSigningBox.new(handle: resp.result["handle"])
|
689
689
|
)
|
690
690
|
else
|
@@ -696,7 +696,7 @@ module TonSdk
|
|
696
696
|
def self.get_signing_box(ctx, params)
|
697
697
|
Interop::request_to_native_lib(ctx, "crypto.get_signing_box", params) do |resp|
|
698
698
|
if resp.success?
|
699
|
-
yield
|
699
|
+
yield NativeLibResponseResult.new(
|
700
700
|
result: RegisteredSigningBox.new(handle: resp.result["handle"])
|
701
701
|
)
|
702
702
|
else
|
@@ -713,7 +713,7 @@ module TonSdk
|
|
713
713
|
is_single_thread_only: is_single_thread_only
|
714
714
|
) do |resp|
|
715
715
|
if resp.success?
|
716
|
-
yield
|
716
|
+
yield NativeLibResponseResult.new(
|
717
717
|
result: ResultOfSigningBoxGetPublicKey.new(pubkey: resp.result["pubkey"])
|
718
718
|
)
|
719
719
|
else
|
@@ -725,7 +725,7 @@ module TonSdk
|
|
725
725
|
def self.signing_box_sign(ctx, params)
|
726
726
|
Interop::request_to_native_lib(ctx, "crypto.signing_box_sign", params) do |resp|
|
727
727
|
if resp.success?
|
728
|
-
yield
|
728
|
+
yield NativeLibResponseResult.new(
|
729
729
|
result: ResultOfSigningBoxSign.new(signature: resp.result["signature"])
|
730
730
|
)
|
731
731
|
else
|
@@ -737,7 +737,7 @@ module TonSdk
|
|
737
737
|
def self.remove_signing_box(ctx, params)
|
738
738
|
Interop::request_to_native_lib(ctx, "crypto.remove_signing_box", params) do |resp|
|
739
739
|
if resp.success?
|
740
|
-
yield
|
740
|
+
yield NativeLibResponseResult.new(
|
741
741
|
result: nil
|
742
742
|
)
|
743
743
|
else
|
@@ -777,7 +777,7 @@ module TonSdk
|
|
777
777
|
is_single_thread_only: false
|
778
778
|
) do |resp|
|
779
779
|
if resp.success?
|
780
|
-
yield
|
780
|
+
yield NativeLibResponseResult.new(
|
781
781
|
result: RegisteredEncryptionBox.new(handle: resp.result["handle"])
|
782
782
|
)
|
783
783
|
else
|
@@ -789,7 +789,7 @@ module TonSdk
|
|
789
789
|
def self.encryption_box_get_info(ctx, params)
|
790
790
|
Interop::request_to_native_lib(ctx, "crypto.encryption_box_get_info", params) do |resp|
|
791
791
|
if resp.success?
|
792
|
-
yield
|
792
|
+
yield NativeLibResponseResult.new(
|
793
793
|
result: ResultOfEncryptionBoxGetInfo.new(info: resp.result["info"])
|
794
794
|
)
|
795
795
|
else
|
@@ -801,7 +801,7 @@ module TonSdk
|
|
801
801
|
def self.create_encryption_box(ctx, params)
|
802
802
|
Interop::request_to_native_lib(ctx, "crypto.create_encryption_box", params) do |resp|
|
803
803
|
if resp.success?
|
804
|
-
yield
|
804
|
+
yield NativeLibResponseResult.new(
|
805
805
|
result: RegisteredEncryptionBox.new(handle: resp.result["handle"])
|
806
806
|
)
|
807
807
|
else
|