web3-eth-accounts
Advanced tools
Comparing version 1.0.0-beta.27 to 1.0.0-beta.28
{ | ||
"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; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62121
1827
+ Addedeth-lib@0.2.7(transitive)
+ Addedweb3-core@1.0.0-beta.28(transitive)
+ Addedweb3-core-helpers@1.0.0-beta.28(transitive)
+ Addedweb3-core-method@1.0.0-beta.28(transitive)
+ Addedweb3-core-promievent@1.0.0-beta.28(transitive)
+ Addedweb3-core-requestmanager@1.0.0-beta.28(transitive)
+ Addedweb3-core-subscriptions@1.0.0-beta.28(transitive)
+ Addedweb3-eth-iban@1.0.0-beta.28(transitive)
+ Addedweb3-providers-http@1.0.0-beta.28(transitive)
+ Addedweb3-providers-ipc@1.0.0-beta.28(transitive)
+ Addedweb3-providers-ws@1.0.0-beta.28(transitive)
+ Addedweb3-utils@1.0.0-beta.28(transitive)
- Removedeth-lib@0.2.5(transitive)
- Removedweb3-core@1.0.0-beta.27(transitive)
- Removedweb3-core-helpers@1.0.0-beta.27(transitive)
- Removedweb3-core-method@1.0.0-beta.27(transitive)
- Removedweb3-core-promievent@1.0.0-beta.27(transitive)
- Removedweb3-core-requestmanager@1.0.0-beta.27(transitive)
- Removedweb3-core-subscriptions@1.0.0-beta.27(transitive)
- Removedweb3-eth-iban@1.0.0-beta.27(transitive)
- Removedweb3-providers-http@1.0.0-beta.27(transitive)
- Removedweb3-providers-ipc@1.0.0-beta.27(transitive)
- Removedweb3-providers-ws@1.0.0-beta.27(transitive)
- Removedweb3-utils@1.0.0-beta.27(transitive)
Updatedeth-lib@0.2.7
Updatedweb3-core@1.0.0-beta.28
Updatedweb3-utils@1.0.0-beta.28