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

@polkadot/keyring

Package Overview
Dependencies
Maintainers
1
Versions
1174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/keyring - npm Package Compare versions

Comparing version 0.38.1 to 0.39.0-beta.0

2

address/decode.js

@@ -31,3 +31,3 @@ "use strict";

const error = message => `Decoding ${encoded}: ${message}`; // assert(defaults.allowedPrefix.includes(decoded[0] as Prefix), error('Invalid decoded address prefix'));
const error = message => "Decoding ".concat(encoded, ": ").concat(message); // assert(defaults.allowedPrefix.includes(decoded[0] as Prefix), error('Invalid decoded address prefix'));

@@ -34,0 +34,0 @@

@@ -25,3 +25,3 @@ "use strict";

const key = (0, _util.u8aToU8a)(_key);
(0, _util.assert)(_defaults.default.allowedDecodedLengths.includes(key.length), `Expected a valid key to convert, with length ${_defaults.default.allowedDecodedLengths}`);
(0, _util.assert)(_defaults.default.allowedDecodedLengths.includes(key.length), "Expected a valid key to convert, with length ".concat(_defaults.default.allowedDecodedLengths));
const isPublicKey = key.length === 32; // generate an input with the prefix and calculate hash

@@ -28,0 +28,0 @@

@@ -69,3 +69,3 @@ "use strict";

options.type = options.type || 'ed25519';
(0, _util.assert)(options && ['ed25519', 'sr25519'].includes(options.type || 'undefined'), `Expected a keyring type of either 'ed25519' or 'sr25519', found '${options.type}`);
(0, _util.assert)(options && ['ed25519', 'sr25519'].includes(options.type || 'undefined'), "Expected a keyring type of either 'ed25519' or 'sr25519', found '".concat(options.type));
this._pairs = new _pairs.default();

@@ -72,0 +72,0 @@ this._type = options.type;

{
"name": "@polkadot/keyring",
"version": "0.38.1",
"version": "0.39.0-beta.0",
"description": "Keyring management",

@@ -33,5 +33,5 @@ "main": "index.js",

"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/util": "^0.38.1",
"@polkadot/util-crypto": "^0.38.1",
"@babel/runtime": "^7.4.0",
"@polkadot/util": "^0.39.0-beta.0",
"@polkadot/util-crypto": "^0.39.0-beta.0",
"@types/bs58": "^4.0.0",

@@ -38,0 +38,0 @@ "bs58": "^4.0.1"

@@ -22,6 +22,6 @@ "use strict";

function decode(passphrase, _encrypted) {
(0, _util.assert)(_encrypted, `No encrypted data available to decode`);
(0, _util.assert)(_encrypted, "No encrypted data available to decode");
const encrypted = _encrypted;
const encoded = passphrase ? (0, _utilCrypto.naclDecrypt)(encrypted.subarray(_defaults.NONCE_LENGTH), encrypted.subarray(0, _defaults.NONCE_LENGTH), (0, _util.u8aFixLength)((0, _util.stringToU8a)(passphrase), 256, true)) : encrypted;
(0, _util.assert)(encoded, `Unable to unencrypt using the supplied passphrase`);
(0, _util.assert)(encoded, "Unable to unencrypt using the supplied passphrase");
const header = encoded.subarray(0, _defaults.PKCS8_HEADER.length);

@@ -28,0 +28,0 @@ (0, _util.assert)(header.toString() === _defaults.PKCS8_HEADER.toString(), 'Invalid Pkcs8 header found in body');

@@ -41,3 +41,3 @@ "use strict";

const formatted = (0, _util.isU8a)(address) || (0, _util.isHex)(address) ? (0, _util.u8aToHex)((0, _util.u8aToU8a)(address)) : address;
return `Unable to retrieve keypair '${formatted}'`;
return "Unable to retrieve keypair '".concat(formatted, "'");
});

@@ -44,0 +44,0 @@ return pair;

@@ -23,31 +23,31 @@ "use strict";

ss: '5GC6LfpV352HtJPySfAecb5JdePtf4R9Vq49NUU8RhzgBq1z',
uri: `${PHRASE}///password`
uri: "".concat(PHRASE, "///password")
}, {
pk: '0x40b9675df90efa6069ff623b0fdfcf706cd47ca7452a5056c7ad58194d23440a',
ss: '5DXZzrDxHbkQov4QBAY4TjpwnHCMrKXkomTnKSw8UArBESDT',
uri: `${PHRASE}/foo`
uri: "".concat(PHRASE, "/foo")
}, {
pk: '0x547d4a55642ec7ebadc0bd29b6e570b8c926059b3c0655d4948075e9a7e6f31e',
ss: '5DyV6fZuvPemWrUqBgWwTSgoV86w6xms3KhkFU6cQcWxTwuv',
uri: `${PHRASE}//foo`
uri: "".concat(PHRASE, "//foo")
}, {
pk: '0x3841947ffcde6f5fef26fb68b59bb8665637e30e32ec2051f99cf6b9c674fe09',
ss: '5DLU27is5iViNopQb2KxsTyPx6j4vCu8X3sk3j3NNLkPCsLj',
uri: `${PHRASE}//foo/bar`
uri: "".concat(PHRASE, "//foo/bar")
}, {
pk: '0xdc142f7476a7b0aa262aeccf207f1d18daa90762db393006741e8a31f39dbc53',
ss: '5H3GPTqDSpjkfDwbHy12PD6BWm8jvGSX4xYC8UMprHpTPhQg',
uri: `${PHRASE}/foo//bar`
uri: "".concat(PHRASE, "/foo//bar")
}, {
pk: '0xa2e56b06407a6d1e819d2fc33fa0ec604b29c2e868b70b3696bb049b8725934b',
ss: '5FkHmNgbg64MwStgCyDi2Uw3ufFu11mqQgmWT9uwK4Lgi3SE',
uri: `${PHRASE}//foo/bar//42/69`
uri: "".concat(PHRASE, "//foo/bar//42/69")
}, {
pk: '0x0e0d24e3e1ff2c07f269c99e2e0df8681fda1851ac42fc846ca2daaa90cd8f14',
ss: '5CP8S23JBNXYNpJsL7ESPJBNnUZE6itcfM4EnDxEhaVEUAWL',
uri: `${PHRASE}//foo/bar//42/69///password`
uri: "".concat(PHRASE, "//foo/bar//42/69///password")
}, {
pk: '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d',
ss: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKv3gB',
uri: `${PHRASE}//Alice`
uri: "".concat(PHRASE, "//Alice")
}];

@@ -65,3 +65,3 @@ describe('keyring.addFromUri', () => {

uri = _ref.uri;
it(`creates ${uri}`, () => {
it("creates ".concat(uri), () => {
const pair = keyring.addFromUri(uri);

@@ -68,0 +68,0 @@ expect((0, _util.u8aToHex)(pair.publicKey())).toEqual(pk);

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