Socket
Socket
Sign inDemoInstall

@ethersproject/wallet

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethersproject/wallet - npm Package Compare versions

Comparing version 5.4.0 to 5.5.0

2

lib.esm/_version.d.ts

@@ -1,2 +0,2 @@

export declare const version = "wallet/5.4.0";
export declare const version = "wallet/5.5.0";
//# sourceMappingURL=_version.d.ts.map

@@ -1,2 +0,2 @@

export const version = "wallet/5.4.0";
export const version = "wallet/5.5.0";
//# sourceMappingURL=_version.js.map

@@ -1,2 +0,2 @@

export declare const version = "wallet/5.4.0";
export declare const version = "wallet/5.5.0";
//# sourceMappingURL=_version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = "wallet/5.4.0";
exports.version = "wallet/5.5.0";
//# sourceMappingURL=_version.js.map

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

function isAccount(value) {
return (value != null && bytes_1.isHexString(value.privateKey, 32) && value.address != null);
return (value != null && (0, bytes_1.isHexString)(value.privateKey, 32) && value.address != null);
}

@@ -87,5 +87,5 @@ function hasMnemonic(value) {

var signingKey_1 = new signing_key_1.SigningKey(privateKey.privateKey);
properties_1.defineReadOnly(_this, "_signingKey", function () { return signingKey_1; });
properties_1.defineReadOnly(_this, "address", transactions_1.computeAddress(_this.publicKey));
if (_this.address !== address_1.getAddress(privateKey.address)) {
(0, properties_1.defineReadOnly)(_this, "_signingKey", function () { return signingKey_1; });
(0, properties_1.defineReadOnly)(_this, "address", (0, transactions_1.computeAddress)(_this.publicKey));
if (_this.address !== (0, address_1.getAddress)(privateKey.address)) {
logger.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");

@@ -95,3 +95,3 @@ }

var srcMnemonic_1 = privateKey.mnemonic;
properties_1.defineReadOnly(_this, "_mnemonic", function () { return ({
(0, properties_1.defineReadOnly)(_this, "_mnemonic", function () { return ({
phrase: srcMnemonic_1.phrase,

@@ -103,3 +103,3 @@ path: srcMnemonic_1.path || hdnode_1.defaultPath,

var node = hdnode_1.HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
if (transactions_1.computeAddress(node.privateKey) !== _this.address) {
if ((0, transactions_1.computeAddress)(node.privateKey) !== _this.address) {
logger.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");

@@ -109,3 +109,3 @@ }

else {
properties_1.defineReadOnly(_this, "_mnemonic", function () { return null; });
(0, properties_1.defineReadOnly)(_this, "_mnemonic", function () { return null; });
}

@@ -119,3 +119,3 @@ }

}
properties_1.defineReadOnly(_this, "_signingKey", function () { return privateKey; });
(0, properties_1.defineReadOnly)(_this, "_signingKey", function () { return privateKey; });
}

@@ -130,6 +130,6 @@ else {

var signingKey_2 = new signing_key_1.SigningKey(privateKey);
properties_1.defineReadOnly(_this, "_signingKey", function () { return signingKey_2; });
(0, properties_1.defineReadOnly)(_this, "_signingKey", function () { return signingKey_2; });
}
properties_1.defineReadOnly(_this, "_mnemonic", function () { return null; });
properties_1.defineReadOnly(_this, "address", transactions_1.computeAddress(_this.publicKey));
(0, properties_1.defineReadOnly)(_this, "_mnemonic", function () { return null; });
(0, properties_1.defineReadOnly)(_this, "address", (0, transactions_1.computeAddress)(_this.publicKey));
}

@@ -140,3 +140,3 @@ /* istanbul ignore if */

}
properties_1.defineReadOnly(_this, "provider", provider || null);
(0, properties_1.defineReadOnly)(_this, "provider", provider || null);
return _this;

@@ -167,5 +167,5 @@ }

var _this = this;
return properties_1.resolveProperties(transaction).then(function (tx) {
return (0, properties_1.resolveProperties)(transaction).then(function (tx) {
if (tx.from != null) {
if (address_1.getAddress(tx.from) !== _this.address) {
if ((0, address_1.getAddress)(tx.from) !== _this.address) {
logger.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);

@@ -175,4 +175,4 @@ }

}
var signature = _this._signingKey().signDigest(keccak256_1.keccak256(transactions_1.serialize(tx)));
return transactions_1.serialize(tx, signature);
var signature = _this._signingKey().signDigest((0, keccak256_1.keccak256)((0, transactions_1.serialize)(tx)));
return (0, transactions_1.serialize)(tx, signature);
});

@@ -183,3 +183,3 @@ };

return __generator(this, function (_a) {
return [2 /*return*/, bytes_1.joinSignature(this._signingKey().signDigest(hash_1.hashMessage(message)))];
return [2 /*return*/, (0, bytes_1.joinSignature)(this._signingKey().signDigest((0, hash_1.hashMessage)(message)))];
});

@@ -205,3 +205,3 @@ });

populated = _a.sent();
return [2 /*return*/, bytes_1.joinSignature(this._signingKey().signDigest(hash_1._TypedDataEncoder.hash(populated.domain, types, populated.value)))];
return [2 /*return*/, (0, bytes_1.joinSignature)(this._signingKey().signDigest(hash_1._TypedDataEncoder.hash(populated.domain, types, populated.value)))];
}

@@ -222,3 +222,3 @@ });

}
return json_wallets_1.encryptKeystore(this, password, options, progressCallback);
return (0, json_wallets_1.encryptKeystore)(this, password, options, progressCallback);
};

@@ -229,3 +229,3 @@ /**

Wallet.createRandom = function (options) {
var entropy = random_1.randomBytes(16);
var entropy = (0, random_1.randomBytes)(16);
if (!options) {

@@ -235,9 +235,9 @@ options = {};

if (options.extraEntropy) {
entropy = bytes_1.arrayify(bytes_1.hexDataSlice(keccak256_1.keccak256(bytes_1.concat([entropy, options.extraEntropy])), 0, 16));
entropy = (0, bytes_1.arrayify)((0, bytes_1.hexDataSlice)((0, keccak256_1.keccak256)((0, bytes_1.concat)([entropy, options.extraEntropy])), 0, 16));
}
var mnemonic = hdnode_1.entropyToMnemonic(entropy, options.locale);
var mnemonic = (0, hdnode_1.entropyToMnemonic)(entropy, options.locale);
return Wallet.fromMnemonic(mnemonic, options.path, options.locale);
};
Wallet.fromEncryptedJson = function (json, password, progressCallback) {
return json_wallets_1.decryptJsonWallet(json, password, progressCallback).then(function (account) {
return (0, json_wallets_1.decryptJsonWallet)(json, password, progressCallback).then(function (account) {
return new Wallet(account);

@@ -247,3 +247,3 @@ });

Wallet.fromEncryptedJsonSync = function (json, password) {
return new Wallet(json_wallets_1.decryptJsonWalletSync(json, password));
return new Wallet((0, json_wallets_1.decryptJsonWalletSync)(json, password));
};

@@ -260,9 +260,9 @@ Wallet.fromMnemonic = function (mnemonic, path, wordlist) {

function verifyMessage(message, signature) {
return transactions_1.recoverAddress(hash_1.hashMessage(message), signature);
return (0, transactions_1.recoverAddress)((0, hash_1.hashMessage)(message), signature);
}
exports.verifyMessage = verifyMessage;
function verifyTypedData(domain, types, value, signature) {
return transactions_1.recoverAddress(hash_1._TypedDataEncoder.hash(domain, types, value), signature);
return (0, transactions_1.recoverAddress)(hash_1._TypedDataEncoder.hash(domain, types, value), signature);
}
exports.verifyTypedData = verifyTypedData;
//# sourceMappingURL=index.js.map
{
"author": "Richard Moore <me@ricmoo.com>",
"dependencies": {
"@ethersproject/abstract-provider": "^5.4.0",
"@ethersproject/abstract-signer": "^5.4.0",
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/hdnode": "^5.4.0",
"@ethersproject/json-wallets": "^5.4.0",
"@ethersproject/keccak256": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/random": "^5.4.0",
"@ethersproject/signing-key": "^5.4.0",
"@ethersproject/transactions": "^5.4.0",
"@ethersproject/wordlists": "^5.4.0"
"@ethersproject/abstract-provider": "^5.5.0",
"@ethersproject/abstract-signer": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
"@ethersproject/bytes": "^5.5.0",
"@ethersproject/hash": "^5.5.0",
"@ethersproject/hdnode": "^5.5.0",
"@ethersproject/json-wallets": "^5.5.0",
"@ethersproject/keccak256": "^5.5.0",
"@ethersproject/logger": "^5.5.0",
"@ethersproject/properties": "^5.5.0",
"@ethersproject/random": "^5.5.0",
"@ethersproject/signing-key": "^5.5.0",
"@ethersproject/transactions": "^5.5.0",
"@ethersproject/wordlists": "^5.5.0"
},

@@ -32,3 +32,3 @@ "description": "Classes for managing, encrypting and decrypting Ethereum private keys as a Signer for ethers.",

],
"gitHead": "c2c0ce75039e7256b287f9a764188d08ed0b7296",
"gitHead": "73a46efea32c3f9a4833ed77896a216e3d3752a0",
"keywords": [

@@ -54,5 +54,5 @@ "Ethereum",

"sideEffects": false,
"tarballHash": "0x2489ce4829cce82fbbb748e70b9a30e5ebba9414d655167051222a08adecff46",
"tarballHash": "0x769743426d97a1e3f789a1b72ec8ae71b8bb1b3bfefd9f4c75474573ded1f502",
"types": "./lib/index.d.ts",
"version": "5.4.0"
"version": "5.5.0"
}

@@ -1,1 +0,1 @@

export const version = "wallet/5.4.0";
export const version = "wallet/5.5.0";

Sorry, the diff of this file is not supported yet

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