junderw
6 years ago
No known key found for this signature in database
GPG Key ID: B256185D3A971908
4 changed files with
41 additions and
15 deletions
-
package-lock.json
-
package.json
-
ts_src/ecpair.ts
-
types/ecpair.d.ts
|
|
@ -1,6 +1,6 @@ |
|
|
|
{ |
|
|
|
"name": "bitcoinjs-lib", |
|
|
|
"version": "5.0.2", |
|
|
|
"version": "5.0.3", |
|
|
|
"lockfileVersion": 1, |
|
|
|
"requires": true, |
|
|
|
"dependencies": { |
|
|
@ -731,9 +731,9 @@ |
|
|
|
"dev": true |
|
|
|
}, |
|
|
|
"nan": { |
|
|
|
"version": "2.12.1", |
|
|
|
"resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", |
|
|
|
"integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" |
|
|
|
"version": "2.14.0", |
|
|
|
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", |
|
|
|
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" |
|
|
|
}, |
|
|
|
"nyc": { |
|
|
|
"version": "13.3.0", |
|
|
@ -1845,6 +1845,31 @@ |
|
|
|
"path-parse": "^1.0.5" |
|
|
|
} |
|
|
|
}, |
|
|
|
"rimraf": { |
|
|
|
"version": "2.6.3", |
|
|
|
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", |
|
|
|
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", |
|
|
|
"dev": true, |
|
|
|
"requires": { |
|
|
|
"glob": "^7.1.3" |
|
|
|
}, |
|
|
|
"dependencies": { |
|
|
|
"glob": { |
|
|
|
"version": "7.1.4", |
|
|
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", |
|
|
|
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", |
|
|
|
"dev": true, |
|
|
|
"requires": { |
|
|
|
"fs.realpath": "^1.0.0", |
|
|
|
"inflight": "^1.0.4", |
|
|
|
"inherits": "2", |
|
|
|
"minimatch": "^3.0.4", |
|
|
|
"once": "^1.3.0", |
|
|
|
"path-is-absolute": "^1.0.0" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
"ripemd160": { |
|
|
|
"version": "2.0.2", |
|
|
|
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", |
|
|
@ -1911,15 +1936,15 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
"tiny-secp256k1": { |
|
|
|
"version": "1.0.1", |
|
|
|
"resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.0.1.tgz", |
|
|
|
"integrity": "sha512-Wz2kMPWtCI5XBftFeF3bUL8uz2+VlasniKwOkRPjvL7h1QVd9rbhrve/HWUu747kJKzVf1XHonzcdM4Ut8fvww==", |
|
|
|
"version": "1.1.1", |
|
|
|
"resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.1.tgz", |
|
|
|
"integrity": "sha512-jA9WalQuhKun1svJrAVi9Vu8aUWKMfR7nMV903kHjrHTTY/IFa0petSq+Jk/Mv447dGD9LC8fGsmGRubBbcNng==", |
|
|
|
"requires": { |
|
|
|
"bindings": "^1.3.0", |
|
|
|
"bn.js": "^4.11.8", |
|
|
|
"create-hmac": "^1.1.7", |
|
|
|
"elliptic": "^6.4.0", |
|
|
|
"nan": "^2.10.0" |
|
|
|
"nan": "^2.13.2" |
|
|
|
} |
|
|
|
}, |
|
|
|
"to-fast-properties": { |
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
{ |
|
|
|
"name": "bitcoinjs-lib", |
|
|
|
"version": "5.0.2", |
|
|
|
"version": "5.0.3", |
|
|
|
"description": "Client-side Bitcoin JavaScript library", |
|
|
|
"main": "./src/index.js", |
|
|
|
"types": "./types/index.d.ts", |
|
|
@ -16,7 +16,7 @@ |
|
|
|
], |
|
|
|
"scripts": { |
|
|
|
"build": "npm run clean && tsc -p ./tsconfig.json && npm run formatjs", |
|
|
|
"clean": "rm -rf src/", |
|
|
|
"clean": "rimraf src", |
|
|
|
"coverage-report": "npm run build && npm run nobuild:coverage-report", |
|
|
|
"coverage-html": "npm run build && npm run nobuild:coverage-html", |
|
|
|
"coverage": "npm run build && npm run nobuild:coverage", |
|
|
@ -56,7 +56,7 @@ |
|
|
|
"merkle-lib": "^2.0.10", |
|
|
|
"pushdata-bitcoin": "^1.0.1", |
|
|
|
"randombytes": "^2.0.1", |
|
|
|
"tiny-secp256k1": "^1.0.0", |
|
|
|
"tiny-secp256k1": "^1.1.1", |
|
|
|
"typeforce": "^1.11.3", |
|
|
|
"varuint-bitcoin": "^1.0.4", |
|
|
|
"wif": "^2.0.1" |
|
|
@ -74,6 +74,7 @@ |
|
|
|
"nyc": "^13.3.0", |
|
|
|
"prettier": "1.16.4", |
|
|
|
"proxyquire": "^2.0.1", |
|
|
|
"rimraf": "^2.6.3", |
|
|
|
"tslint": "5.13.1", |
|
|
|
"typescript": "3.2.2" |
|
|
|
}, |
|
|
|
|
|
@ -26,7 +26,7 @@ export interface ECPairInterface { |
|
|
|
publicKey?: Buffer; |
|
|
|
toWIF(): string; |
|
|
|
sign(hash: Buffer): Buffer; |
|
|
|
verify(hash: Buffer, signature: Buffer): Buffer; |
|
|
|
verify(hash: Buffer, signature: Buffer): boolean; |
|
|
|
getPublicKey?(): Buffer; |
|
|
|
} |
|
|
|
|
|
|
@ -66,7 +66,7 @@ class ECPair implements ECPairInterface { |
|
|
|
return ecc.sign(hash, this.__D); |
|
|
|
} |
|
|
|
|
|
|
|
verify(hash: Buffer, signature: Buffer): Buffer { |
|
|
|
verify(hash: Buffer, signature: Buffer): boolean { |
|
|
|
return ecc.verify(hash, this.publicKey, signature); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -12,7 +12,7 @@ export interface ECPairInterface { |
|
|
|
publicKey?: Buffer; |
|
|
|
toWIF(): string; |
|
|
|
sign(hash: Buffer): Buffer; |
|
|
|
verify(hash: Buffer, signature: Buffer): Buffer; |
|
|
|
verify(hash: Buffer, signature: Buffer): boolean; |
|
|
|
getPublicKey?(): Buffer; |
|
|
|
} |
|
|
|
declare class ECPair implements ECPairInterface { |
|
|
@ -25,7 +25,7 @@ declare class ECPair implements ECPairInterface { |
|
|
|
readonly publicKey: Buffer | undefined; |
|
|
|
toWIF(): string; |
|
|
|
sign(hash: Buffer): Buffer; |
|
|
|
verify(hash: Buffer, signature: Buffer): Buffer; |
|
|
|
verify(hash: Buffer, signature: Buffer): boolean; |
|
|
|
} |
|
|
|
declare function fromPrivateKey(buffer: Buffer, options?: ECPairOptions): ECPair; |
|
|
|
declare function fromPublicKey(buffer: Buffer, options?: ECPairOptions): ECPair; |
|
|
|