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.7.23 to 0.7.24

2

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

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

@@ -50,3 +50,3 @@ const Buffer = require('buffer/').Buffer

def.params.forEach((param) => {
if (!param.name || !param.latticeTypeIdx || param.isArray === undefined || param.arraySz === undefined)
if (param.name === undefined || param.latticeTypeIdx === undefined || param.isArray === undefined || param.arraySz === undefined)
throw new Error('name, latticeTypeIdx, isArray, and arraySz must be defined for all ABI params.');

@@ -137,28 +137,33 @@ Buffer.from(param.name).slice(0, 20).copy(b, off); off += 20;

const closeBracketIdx = typeName.indexOf(']');
if (openBracketIdx > -1 && closeBracketIdx > -1) {
if (openBracketIdx >= closeBracketIdx) {
; // not a valid param -- skip it
} else if ((openBracketIdx + 1) === closeBracketIdx) {
d.isArray = true;
} else {
// Parse the array size if applicable
const number = parseInt(typeName.slice(openBracketIdx, closeBracketIdx))
if (isNaN(number)) {
return d;
const isMultiDim = typeName.split('[').length > 2;
if (isMultiDim) {
throw new Error('Skipping function with unsupported multidimensional array type')
} else {
if (openBracketIdx > -1 && closeBracketIdx > -1) {
if (openBracketIdx >= closeBracketIdx) {
; // not a valid param -- skip it
} else if ((openBracketIdx + 1) === closeBracketIdx) {
d.isArray = true;
} else {
// Parse the array size if applicable
const number = parseInt(typeName.slice(openBracketIdx, closeBracketIdx))
if (isNaN(number)) {
return d;
}
d.isArray = true;
d.arraySz = number;
}
d.isArray = true;
d.arraySz = number;
}
let singularTypeName = openBracketIdx > -1 ? typeName.slice(0, openBracketIdx) : typeName;
if (singularTypeName === 'tuple') {
if (isNestedTuple === true)
throw new Error('Nested tuples are not supported')
singularTypeName = `tuple${input.components.length}`;
tupleParams = parseEtherscanAbiInputs(input.components, tupleParams, true);
}
d.latticeTypeIdx = getTypeIdxLatticeFw(singularTypeName)
if (!d.latticeTypeIdx)
throw new Error(`Unsupported type: ${typeName}`)
data.push(d)
}
let singularTypeName = openBracketIdx > -1 ? typeName.slice(0, openBracketIdx) : typeName;
if (singularTypeName === 'tuple') {
if (isNestedTuple === true)
throw new Error('Nested tuples are not supported')
singularTypeName = `tuple${input.components.length}`;
tupleParams = parseEtherscanAbiInputs(input.components, tupleParams, true);
}
d.latticeTypeIdx = getTypeIdxLatticeFw(singularTypeName)
if (!d.latticeTypeIdx)
throw new Error(`Unsupported type: ${typeName}`)
data.push(d)
})

@@ -165,0 +170,0 @@ const params = data.concat(tupleParams)

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