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

web3-eth-accounts

Package Overview
Dependencies
Maintainers
1
Versions
479
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-eth-accounts - npm Package Compare versions

Comparing version 1.0.0-beta.27 to 1.0.0-beta.28

12

package.json
{
"name": "web3-eth-accounts",
"namespace": "ethereum",
"version": "1.0.0-beta.27",
"version": "1.0.0-beta.28",
"description": "Web3 module to generate Ethereum accounts and sign data and transactions.",

@@ -12,11 +12,11 @@ "repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3-eth-accounts",

"crypto-browserify": "^3.12.0",
"eth-lib": "0.2.5",
"eth-lib": "0.2.7",
"scrypt.js": "0.2.0",
"underscore": "1.8.3",
"uuid": "2.0.1",
"web3-core": "1.0.0-beta.27",
"web3-core-helpers": "1.0.0-beta.27",
"web3-core-method": "1.0.0-beta.27",
"web3-utils": "1.0.0-beta.27"
"web3-core": "1.0.0-beta.28",
"web3-core-helpers": "1.0.0-beta.28",
"web3-core-method": "1.0.0-beta.28",
"web3-utils": "1.0.0-beta.28"
}
}

@@ -44,2 +44,17 @@ /*

var trimLeadingZero = function (hex) {
while (hex && hex.startsWith('0x0')) {
hex = '0x' + hex.slice(3);
}
return hex;
};
var makeEven = function (hex) {
if(hex.length % 2 === 1) {
hex = hex.replace('0x', '0x0');
}
return hex;
};
var Accounts = function Accounts() {

@@ -150,5 +165,9 @@ var _this = this;

var signature = Account.makeSigner(Nat.toNumber(transaction.chainId || "0x1") * 2 + 35)(Hash.keccak256(rlpEncoded), privateKey);
var signature = Account.makeSigner(Nat.toNumber(transaction.chainId || "0x1") * 2 + 35)(Hash.keccak256(rlpEncoded), privateKey);
var rawTx = RLP.decode(rlpEncoded).slice(0,6).concat(Account.decodeSignature(signature));
var rawTx = RLP.decode(rlpEncoded).slice(0, 6).concat(Account.decodeSignature(signature));
rawTx[7] = makeEven(trimLeadingZero(rawTx[7]));
rawTx[8] = makeEven(trimLeadingZero(rawTx[8]));
var rawTransaction = RLP.encode(rawTx);

@@ -159,5 +178,5 @@

messageHash: hash,
v: values[6],
r: values[7],
s: values[8],
v: trimLeadingZero(values[6]),
r: trimLeadingZero(values[7]),
s: trimLeadingZero(values[8]),
rawTransaction: rawTransaction

@@ -399,3 +418,3 @@ };

if (account) {
if (account && account.address) {
// address

@@ -402,0 +421,0 @@ this[account.address].privateKey = null;

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