Comparing version 1.4.0 to 1.4.1
{ | ||
"name": "eosjs", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "General purpose library for the EOS blockchain.", | ||
@@ -20,3 +20,3 @@ "main": "index.js", | ||
"author": "", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -34,4 +34,4 @@ "url": "https://github.com/EOSIO/eosjs/issues" | ||
"create-hash": "^1.1.3", | ||
"eosjs-api": "^1.2.2", | ||
"eosjs-ecc": "^1.2.0", | ||
"eosjs-api": "^1.2.3", | ||
"eosjs-ecc": "^1.3.2", | ||
"eosjs-json": "^1.3.0", | ||
@@ -38,0 +38,0 @@ "fcbuffer": "^1.2.0" |
@@ -39,2 +39,4 @@ [](https://travis-ci.org/EOSIO/eosjs) | ||
Read-only API methods and documentation are generated from [chain.json](https://github.com/EOSIO/eosjs-json/blob/master/api/v1/chain.json). | ||
### Usage (read/write) | ||
@@ -61,2 +63,4 @@ | ||
Read-write API methods and documentation are generated from this [schema](https://github.com/EOSIO/eosjs-json/blob/master/schema/generated.json). | ||
For more advanced signing, see `keyProvider` in the [unit test](./index.test.js). | ||
@@ -63,0 +67,0 @@ |
@@ -8,3 +8,3 @@ const ecc = require('eosjs-ecc') | ||
const {Signature} = ecc | ||
const {sign} = ecc | ||
@@ -222,20 +222,2 @@ function writeApiGen(Network, network, structs, config) { | ||
/** | ||
The transaction function signs already. This is for signing other types | ||
of data. | ||
@arg {string|Buffer} data - Never sign anything without 100% validation or | ||
unless prefixing with a string constant. | ||
@arg {string|ecc.PrivateKey} key - string must be a valid WIF format | ||
@return {string} hex signature | ||
*/ | ||
function sign(data, key) { | ||
const privateKey = key.d ? key : ecc.PrivateKey.fromWif(key) | ||
const h = createHash('sha256').update(data).digest(); | ||
const sig = Signature.signBufferSha256(h, privateKey) | ||
return sig.toHex() | ||
} | ||
const checkError = (parentErr, parrentRes) => (error, result) => { | ||
@@ -242,0 +224,0 @@ if (error) { |
199
39682
955
Updatedeosjs-api@^1.2.3
Updatedeosjs-ecc@^1.3.2