Comparing version 0.4.0 to 0.4.1
@@ -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
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
113294
66
1933
+ Added@findeth/abi@^0.3.0
+ Added@findeth/abi@0.3.1(transitive)
- Removed@ethersproject/abi@^5.0.3
- Removed@ethersproject/abi@5.7.0(transitive)
- Removed@ethersproject/abstract-provider@5.7.0(transitive)
- Removed@ethersproject/abstract-signer@5.7.0(transitive)
- Removed@ethersproject/address@5.7.0(transitive)
- Removed@ethersproject/base64@5.7.0(transitive)
- Removed@ethersproject/bignumber@5.7.0(transitive)
- Removed@ethersproject/bytes@5.7.0(transitive)
- Removed@ethersproject/constants@5.7.0(transitive)
- Removed@ethersproject/hash@5.7.0(transitive)
- Removed@ethersproject/keccak256@5.7.0(transitive)
- Removed@ethersproject/logger@5.7.0(transitive)
- Removed@ethersproject/networks@5.7.1(transitive)
- Removed@ethersproject/properties@5.7.0(transitive)
- Removed@ethersproject/rlp@5.7.0(transitive)
- Removed@ethersproject/signing-key@5.7.0(transitive)
- Removed@ethersproject/strings@5.7.0(transitive)
- Removed@ethersproject/transactions@5.7.0(transitive)
- Removed@ethersproject/web@5.7.1(transitive)
- Removedbn.js@4.12.15.2.1(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedelliptic@6.5.4(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedjs-sha3@0.8.0(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)