New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gridplus-sdk

Package Overview
Dependencies
Maintainers
1
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridplus-sdk - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

2

package.json
{
"name": "gridplus-sdk",
"version": "0.8.2",
"version": "0.8.3",
"description": "SDK to interact with GridPlus Lattice1 device",

@@ -5,0 +5,0 @@ "scripts": {

@@ -49,6 +49,8 @@ // Utils for Ethereum transactions. This is effecitvely a shim of ethereumjs-util, which

Buffer.from(keccak256(Buffer.concat([get_personal_sign_prefix(msg.length), msg])), 'hex');
// Get recovery param with a `v` value of [27,28] by setting `useEIP155=false`
return addRecoveryParam(hash, sig, signer, { chainId: 1, useEIP155: false })
} else if (input.protocol === 'eip712') {
const digest = prehash ? prehash : eip712.TypedDataUtils.encodeDigest(req.input.payload);
return addRecoveryParam(digest, sig, signer, { type: 'EIP712_MSG' })
// Get recovery param with a `v` value of [27,28] by setting `useEIP155=false`
return addRecoveryParam(digest, sig, signer, { useEIP155: false })
} else {

@@ -410,10 +412,7 @@ throw new Error('Unsupported protocol');

return ensureHexBuffer(v, true); // 0 or 1, with 0 expected as an empty buffer
} else if (type === 'EIP712_MSG') {
return ensureHexBuffer(v, false); // 0 or 1, with 0 expected as a number
} else if (false === useEIP155 || chainId === null) {
// For ETH messages and non-EIP155 chains the set should be [27, 28] for `v`
return Buffer.from(new BN(v).plus(27).toString(16), 'hex');
}
// If we are not using EIP155, convert v directly to a buffer and return it
if (false === useEIP155 || chainId === null)
return Buffer.from(new BN(v).plus(27).toString(16), 'hex');
// We will use EIP155 in most cases. Convert v to a bignum and operate on it.

@@ -420,0 +419,0 @@ // Note that the protocol calls for v = (CHAIN_ID*2) + 35/36, where 35 or 36

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