eth-sig-util
Advanced tools
Comparing version 2.5.3 to 3.0.0
@@ -132,3 +132,3 @@ /// <reference types="node" /> | ||
*/ | ||
sign<T_1 extends MessageTypes>(typedData: string | Partial<EIP712TypedData> | EIP712TypedData[] | Partial<TypedMessage<T_1>>, useV4?: boolean): Buffer; | ||
sign<T_1 extends MessageTypes>(typedData: string | EIP712TypedData[] | Partial<EIP712TypedData> | Partial<TypedMessage<T_1>>, useV4?: boolean): Buffer; | ||
}; | ||
@@ -135,0 +135,0 @@ declare function concatSig(v: Buffer, r: Buffer, s: Buffer): string; |
@@ -14,2 +14,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.recoverTypedSignature_v4 = exports.recoverTypedSignature = exports.signTypedData_v4 = exports.signTypedData = exports.recoverTypedMessage = exports.signTypedMessage = exports.getEncryptionPublicKey = exports.decryptSafely = exports.decrypt = exports.encryptSafely = exports.encrypt = exports.recoverTypedSignatureLegacy = exports.signTypedDataLegacy = exports.typedSignatureHash = exports.extractPublicKey = exports.recoverPersonalSignature = exports.personalSign = exports.normalize = exports.concatSig = exports.TypedDataUtils = exports.TYPED_MESSAGE_SCHEMA = void 0; | ||
var ethUtil = require("ethereumjs-util"); | ||
@@ -126,3 +127,3 @@ var ethAbi = require("ethereumjs-abi"); | ||
else if (field.type.lastIndexOf(']') === field.type.length - 1) { | ||
throw new Error('Arrays currently unimplemented in encodeData'); | ||
throw new Error('Arrays are unimplemented in encodeData; use V4 extension'); | ||
} | ||
@@ -129,0 +130,0 @@ else { |
{ | ||
"name": "eth-sig-util", | ||
"version": "2.5.3", | ||
"version": "3.0.0", | ||
"description": "A few useful functions for signing ethereum data", | ||
@@ -14,4 +14,5 @@ "main": "index.js", | ||
"lint": "eslint . --ext .ts,.js", | ||
"test": "npm run build && node test/index.js", | ||
"prepublishOnly": "npm run build" | ||
"test": "yarn build && node test/index.js", | ||
"test:browser": "yarn build && browserify test/index.js > test/bundle.js && echo ';window.close();' >> test/bundle.js && cat test/bundle.js | smokestack", | ||
"prepublishOnly": "yarn build" | ||
}, | ||
@@ -32,2 +33,6 @@ "repository": { | ||
"homepage": "https://github.com/MetaMask/eth-sig-util#readme", | ||
"resolutions": { | ||
"smokestack/minimist": "^1.2.5", | ||
"smokestack/shoe/sockjs/node-uuid": "^1.4.4" | ||
}, | ||
"dependencies": { | ||
@@ -46,7 +51,9 @@ "buffer": "^5.2.1", | ||
"@typescript-eslint/parser": "^2.20.0", | ||
"browserify": "^16.5.1", | ||
"eslint": "^6.8.0", | ||
"eslint-plugin-import": "^2.20.1", | ||
"smokestack": "^3.6.0", | ||
"tape": "^4.9.1", | ||
"typescript": "3.7.4" | ||
"typescript": "^3.9.2" | ||
} | ||
} |
@@ -5,13 +5,6 @@ # Eth-Sig-Util [![CircleCI](https://circleci.com/gh/MetaMask/eth-sig-util.svg?style=svg)](https://circleci.com/gh/MetaMask/eth-sig-util) | ||
You can find usage examples [here](https://github.com/flyswatter/js-eth-personal-sign-examples) | ||
You can find usage examples [here](https://github.com/danfinlay/js-eth-personal-sign-examples) | ||
[Available on NPM](https://www.npmjs.com/package/eth-sig-util) | ||
## Supported Signing Methods | ||
Currently there is only one supported signing protocol. More will be added as standardized. | ||
- Personal Sign (`personal_sign`) [geth thread](https://github.com/ethereum/go-ethereum/pull/2940) | ||
## Installation | ||
@@ -73,2 +66,10 @@ | ||
### recoverTypedSignature_V4 ({data, sig}) | ||
Return address of a signer that did `signTypedData` as per an extension of the published version of [EIP 712](https://github.com/MetaMask/eth-sig-util/pull/54). | ||
This extension adds support for arrays and recursive data types. | ||
Expects the same data that were used for signing. `sig` is a prefixed signature. | ||
### typedSignatureHash (typedData) | ||
@@ -75,0 +76,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
39324
6
823
83
10