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

eip-712

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eip-712 - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

lib/cjs/utils/abi.js

8

lib/cjs/eip-712.js

@@ -8,6 +8,6 @@ "use strict";

var _abi = require("@ethersproject/abi");
var _utils = require("./utils");
var _abi = require("./utils/abi");
const EIP_191_PREFIX = Buffer.from('1901', 'hex');

@@ -79,3 +79,3 @@

const values = encodedData.map(item => item[1]);
return ['bytes32', (0, _utils.keccak256)(_abi.defaultAbiCoder.encode(types, values))];
return ['bytes32', (0, _utils.keccak256)((0, _abi.encode)(types, values))];
}

@@ -108,3 +108,3 @@

}, [['bytes32'], [getTypeHash(typedData, type)]]);
return (0, _utils.toBuffer)(_abi.defaultAbiCoder.encode(types, values));
return (0, _abi.encode)(types, values);
};

@@ -111,0 +111,0 @@

@@ -7,2 +7,14 @@ "use strict";

var _abi = require("./abi");
Object.keys(_abi).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _abi[key];
}
});
});
var _buffer = require("./buffer");

@@ -9,0 +21,0 @@

@@ -1,3 +0,3 @@

import { defaultAbiCoder } from '@ethersproject/abi';
import { keccak256, toBuffer, validateTypedData, TYPE_REGEX, ARRAY_REGEX, isValidType } from './utils';
import { encode } from './utils/abi';
const EIP_191_PREFIX = Buffer.from('1901', 'hex');

@@ -60,3 +60,3 @@ export const getDependencies = (typedData, type, dependencies = []) => {

const values = encodedData.map(item => item[1]);
return ['bytes32', keccak256(defaultAbiCoder.encode(types, values))];
return ['bytes32', keccak256(encode(types, values))];
}

@@ -89,3 +89,3 @@

}, [['bytes32'], [getTypeHash(typedData, type)]]);
return toBuffer(defaultAbiCoder.encode(types, values));
return encode(types, values);
};

@@ -92,0 +92,0 @@ export const getStructHash = (typedData, type, data) => {

@@ -0,1 +1,2 @@

export * from './abi';
export * from './buffer';

@@ -2,0 +3,0 @@ export * from './json';

{
"name": "eip-712",
"version": "0.4.0",
"version": "0.4.1",
"description": "Utility functions that can help with signing and verifying EIP-712 based messages",

@@ -47,4 +47,4 @@ "author": "Maarten Zuidhoorn <maarten@zuidhoorn.com>",

"dependencies": {
"@ethersproject/abi": "^5.0.3",
"@exodus/schemasafe": "^1.0.0-rc.2",
"@findeth/abi": "^0.3.0",
"keccak": "^3.0.1"

@@ -51,0 +51,0 @@ },

@@ -137,3 +137,3 @@ import invalidArrayLength from './__fixtures__/invalid-array-length.json';

expect(encodeData(arrayTypedData, 'Mail', arrayTypedData.message).toString('hex')).toBe(
'b303efe9556a96b94a4900cf57bc81a6cc6d0b5047eb060c744f3baa7221385bfc71e5fa27ff56c350aa531bc129ebdf613b772b6604664f5d8dbe21b85eb0c8cea9e1c1b3d2ec0f0b45fcbf28f5e0e0d9240649bdb5a764f4c3a7acb9ab7f51c1c8738fb1e0a328b2d14d29f3dc9714e40c269598d60e4ab780afc5603a8678'
'b303efe9556a96b94a4900cf57bc81a6cc6d0b5047eb060c744f3baa7221385bfc71e5fa27ff56c350aa531bc129ebdf613b772b6604664f5d8dbe21b85eb0c8392bb8ab5338a9075ce8fec1b431e334007d4de1e5e83201ca35762e24428e24b7c4150525d88db452c5f08f93f4593daa458ab6280b012532183aed3a8e4a01'
);

@@ -140,0 +140,0 @@ });

@@ -1,4 +0,4 @@

import { defaultAbiCoder } from '@ethersproject/abi';
import { TypedData } from './types';
import { keccak256, toBuffer, validateTypedData, TYPE_REGEX, ARRAY_REGEX, isValidType } from './utils';
import { encode } from './utils/abi';

@@ -110,3 +110,3 @@ const EIP_191_PREFIX = Buffer.from('1901', 'hex');

return ['bytes32', keccak256(defaultAbiCoder.encode(types, values))];
return ['bytes32', keccak256(encode(types, values))];
}

@@ -157,3 +157,3 @@

return toBuffer(defaultAbiCoder.encode(types, values));
return encode(types, values);
};

@@ -160,0 +160,0 @@

@@ -0,3 +1,4 @@

export * from './abi';
export * from './buffer';
export * from './json';
export * from './types';

@@ -0,3 +1,4 @@

export * from './abi';
export * from './buffer';
export * from './json';
export * from './types';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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