Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@near-js/crypto

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@near-js/crypto - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

12

lib/public_key.js

@@ -35,7 +35,10 @@ "use strict";

const parts = encodedKey.split(':');
let publicKey;
let keyType = constants_1.KeyType.ED25519;
if (parts.length === 1) {
return new PublicKey({ keyType: constants_1.KeyType.ED25519, data: (0, borsh_1.baseDecode)(parts[0]) });
publicKey = parts[0];
}
else if (parts.length === 2) {
return new PublicKey({ keyType: str_to_key_type(parts[0]), data: (0, borsh_1.baseDecode)(parts[1]) });
publicKey = parts[1];
keyType = str_to_key_type(parts[0]);
}

@@ -45,2 +48,7 @@ else {

}
const decodedPublicKey = (0, borsh_1.baseDecode)(publicKey);
if (decodedPublicKey.length !== tweetnacl_1.default.box.publicKeyLength) {
throw new Error(`Invalid public key size (${decodedPublicKey.length}), must be ${tweetnacl_1.default.box.publicKeyLength}`);
}
return new PublicKey({ keyType, data: decodedPublicKey });
}

@@ -47,0 +55,0 @@ toString() {

2

package.json
{
"name": "@near-js/crypto",
"version": "0.0.4",
"version": "0.0.5",
"description": "Abstractions around NEAR-compatible elliptical curves and cryptographic keys",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc