ton_sdk_client 1.16.1 → 1.17.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 +5 -0
- data/README.md +1 -1
- data/lib/ton_sdk_client/crypto.rb +57 -0
- data/lib/ton_sdk_client/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 611b507cb9f4b904651663ac9d6de9c35730c1fdb246174c591b1c9e18b2e2c1
|
4
|
+
data.tar.gz: f86b4cbd48751a2853263ee20ffc642cd9af9afcd67c7a64aa6a8c3d240f48b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8f11f0c94deff6280c93206990b747712798f668b2d1edd15540245335780dc07f8e7093d7c905744774d051671c816533a4547ee501b47721fc6af6af3487c
|
7
|
+
data.tar.gz: 43b87245c92344484bac45ff9c095e2ee5d93b0869bc16cc7668d33794a6bbb8c9092adf6d3ff571220782fc8cf92a22d31620476b175ba376876c833f5ae094
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# TON SDK client in Ruby and for Ruby
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/ton_sdk_client)
|
4
|
-
[](https://github.com/tonlabs/TON-SDK/tree/1.17.0)
|
5
5
|
|
6
6
|
Ruby gem-client bindings for [TON SDK](https://github.com/tonlabs/TON-SDK) which allows one to communicate with [FreeTON](https://freeton.org) blockchain in Ruby.
|
7
7
|
|
@@ -265,6 +265,11 @@ module TonSdk
|
|
265
265
|
end
|
266
266
|
end
|
267
267
|
|
268
|
+
EncryptionBoxInfo = Struct.new(:hdpath, :algorithm, :options, :public, keyword_init: true)
|
269
|
+
ParamsOfEncryptionBoxGetInfo = Struct.new(:encryption_box)
|
270
|
+
ResultOfEncryptionBoxGetInfo = Struct.new(:info)
|
271
|
+
RegisteredEncryptionBox = Struct.new(:handle)
|
272
|
+
|
268
273
|
|
269
274
|
#
|
270
275
|
# functions
|
@@ -762,5 +767,57 @@ module TonSdk
|
|
762
767
|
end
|
763
768
|
end
|
764
769
|
end
|
770
|
+
|
771
|
+
def self.register_encryption_box(ctx, app_obj:)
|
772
|
+
client_callback = Proc.new do |type_, x|
|
773
|
+
app_res = app_obj.request(x["request_data"])
|
774
|
+
app_req_result = case app_res
|
775
|
+
in [:success, result]
|
776
|
+
TonSdk::Client::AppRequestResult.new(
|
777
|
+
type_: :ok,
|
778
|
+
result: result
|
779
|
+
)
|
780
|
+
in [:error, text]
|
781
|
+
TonSdk::Client::AppRequestResult.new(
|
782
|
+
type_: :error,
|
783
|
+
text: text
|
784
|
+
)
|
785
|
+
end
|
786
|
+
|
787
|
+
params = TonSdk::Client::ParamsOfResolveAppRequest.new(
|
788
|
+
app_request_id: x["app_request_id"],
|
789
|
+
result: app_req_result
|
790
|
+
)
|
791
|
+
TonSdk::Client.resolve_app_request(ctx, params)
|
792
|
+
end
|
793
|
+
|
794
|
+
Interop::request_to_native_lib(
|
795
|
+
ctx,
|
796
|
+
"crypto.register_encryption_box",
|
797
|
+
nil,
|
798
|
+
client_callback: client_callback,
|
799
|
+
is_single_thread_only: false
|
800
|
+
) do |resp|
|
801
|
+
if resp.success?
|
802
|
+
yield NativeLibResponsetResult.new(
|
803
|
+
result: RegisteredEncryptionBox.new(resp.result["handle"])
|
804
|
+
)
|
805
|
+
else
|
806
|
+
yield resp
|
807
|
+
end
|
808
|
+
end
|
809
|
+
end
|
810
|
+
|
811
|
+
def self.encryption_box_get_info(ctx, params)
|
812
|
+
Interop::request_to_native_lib(ctx, "crypto.encryption_box_get_info", params) do |resp|
|
813
|
+
if resp.success?
|
814
|
+
yield NativeLibResponsetResult.new(
|
815
|
+
result: ResultOfEncryptionBoxGetInfo.new(resp.result["info"])
|
816
|
+
)
|
817
|
+
else
|
818
|
+
yield resp
|
819
|
+
end
|
820
|
+
end
|
821
|
+
end
|
765
822
|
end
|
766
823
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ton_sdk_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Maslakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|