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.3 to 0.8.4

2

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

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

@@ -132,2 +132,4 @@ // Utils for Ethereum transactions. This is effecitvely a shim of ethereumjs-util, which

throw new Error('EIP1559 transactions must include `maxFeePerGas`');
if (data.maxPriorityFeePerGas > data.maxFeePerGas)
throw new Error('maxPriorityFeePerGas must be <= maxFeePerGas');
maxPriorityFeePerGasBytes = ensureHexBuffer(data.maxPriorityFeePerGas);

@@ -256,17 +258,18 @@ rawTx.push(maxPriorityFeePerGasBytes);

let prehash = null;
if (dataBytes && dataBytes.length > MAX_BASE_DATA_SZ) {
// Create the buffer, prefix with chainId (if needed) and add data slice
const dataSz = dataBytes.length || 0;
const chainIdExtraSz = chainIdBufSz > 0 ? chainIdBufSz + 1 : 0;
const dataToCopy = Buffer.alloc(dataSz + chainIdExtraSz);
if (chainIdExtraSz > 0) {
dataToCopy.writeUInt8(chainIdBufSz, 0);
chainIdBuf.copy(dataToCopy, 1);
}
dataBytes.copy(dataToCopy, chainIdExtraSz);
if (dataSz > MAX_BASE_DATA_SZ) {
// Determine sizes and run through sanity checks
const chainIdExtraSz = chainIdBufSz > 0 ? chainIdBufSz + 1 : 0;
const totalSz = dataBytes.length + chainIdExtraSz;
const totalSz = dataSz + chainIdExtraSz;
const maxSzAllowed = MAX_BASE_DATA_SZ + (extraDataMaxFrames * extraDataFrameSz);
// Copy the data into a tmp buffer. Account for larger chain ID sizes if applicable.
const dataToCopy = Buffer.alloc(dataBytes.length + chainIdExtraSz)
if (chainIdExtraSz > 0) {
dataToCopy.writeUInt8(chainIdBufSz, 0);
chainIdBuf.copy(dataToCopy, 1);
dataBytes.copy(dataToCopy, chainIdExtraSz);
} else {
dataBytes.copy(dataToCopy, 0);
}
if (prehashAllowed && totalSz > maxSzAllowed) {

@@ -273,0 +276,0 @@ // If this payload is too large to send, but the Lattice allows a prehashed message, do that

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