near_api 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/near_api/key.rb +7 -3
- data/lib/near_api/version.rb +1 -1
- 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: '0178927f06a7b596da0c8080f4893136fc151fea0c554bc98c6875e69e5ce989'
|
4
|
+
data.tar.gz: 8b2767b1c427ebe6028efa2337088aa7513d53fad440afac6ec6e7e53acb6be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 202b1e0c31d69c5c49eb95b57d78fdec369b01a28e8f5d963b4b18acdcd9d790c24983663e4dd94c695ca63d029657a8be13dc0a2511e44d5cd1e95fe7263a43
|
7
|
+
data.tar.gz: ca770893644ba4aa94c1c5b857aa0363b8e66c7e2b655a2b326d05261dde96025a1089c1f3036eb737bbe272d8f3528a8648dae291cb45d4edd40b641982bb6c
|
data/lib/near_api/key.rb
CHANGED
@@ -9,8 +9,8 @@ class NearApi::Key
|
|
9
9
|
key_pair: ENV.fetch('NEAR_KEYPAIR', nil),
|
10
10
|
public_key: ENV.fetch('NEAR_PUBLIC_KEY', nil))
|
11
11
|
@signer_id = signer_id
|
12
|
-
if
|
13
|
-
raise ArgumentError, 'please specify
|
12
|
+
if key_pair.nil? && public_key.nil?
|
13
|
+
raise ArgumentError, 'please specify key_pair or public_key'
|
14
14
|
end
|
15
15
|
|
16
16
|
unless key_pair.nil?
|
@@ -31,7 +31,11 @@ class NearApi::Key
|
|
31
31
|
public_key
|
32
32
|
end
|
33
33
|
bytestring = NearApi::Base58.decode(key_value)
|
34
|
-
|
34
|
+
verify_key = Ed25519::VerifyKey.new(bytestring).to_bytes
|
35
|
+
unless @public_key.nil?
|
36
|
+
raise ArgumentError, 'public_key does not match keypair' if @public_key != verify_key
|
37
|
+
end
|
38
|
+
@public_key = verify_key
|
35
39
|
end
|
36
40
|
end
|
37
41
|
|
data/lib/near_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: near_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serg Tyatin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: borsh-rb
|