@ledgerhq/hw-app-btc
Advanced tools
Comparing version 1.0.8 to 1.1.0-beta.8cc6fdd9
@@ -1,3 +0,3 @@ | ||
// flow-typed signature: 292be4275bd775765b32a0a71e7603d3 | ||
// flow-typed version: <<STUB>>/@ledgerhq/hw-transport_v^1.0.5/flow_v0.63.1 | ||
// flow-typed signature: 91b46c276b3d4c3a35e1ca40b7e6e947 | ||
// flow-typed version: <<STUB>>/@ledgerhq/hw-transport_v^1.0.8/flow_v0.63.1 | ||
@@ -25,3 +25,3 @@ /** | ||
*/ | ||
declare module '@ledgerhq/hw-transport/src/Comm' { | ||
declare module '@ledgerhq/hw-transport/src/Transport' { | ||
declare module.exports: any; | ||
@@ -31,4 +31,4 @@ } | ||
// Filename aliases | ||
declare module '@ledgerhq/hw-transport/src/Comm.js' { | ||
declare module.exports: $Exports<'@ledgerhq/hw-transport/src/Comm'>; | ||
declare module '@ledgerhq/hw-transport/src/Transport.js' { | ||
declare module.exports: $Exports<'@ledgerhq/hw-transport/src/Transport'>; | ||
} |
@@ -42,10 +42,10 @@ "use strict"; | ||
* import Btc from "@ledgerhq/hw-app-btc"; | ||
* const btc = new Btc(comm) | ||
* const btc = new Btc(transport) | ||
*/ | ||
var Btc = function () { | ||
function Btc(comm) { | ||
function Btc(transport) { | ||
_classCallCheck(this, Btc); | ||
this.comm = comm; | ||
comm.setScrambleKey("BTC"); | ||
this.transport = transport; | ||
transport.setScrambleKey("BTC"); | ||
} | ||
@@ -74,3 +74,3 @@ | ||
}); | ||
return this.comm.exchange(buffer.toString("hex"), [0x9000]).then(function (responseHex) { | ||
return this.transport.exchange(buffer.toString("hex"), [0x9000]).then(function (responseHex) { | ||
var response = Buffer.from(responseHex, "hex"); | ||
@@ -105,3 +105,3 @@ var publicKeyLength = response[0]; | ||
buffer = Buffer.concat([buffer, data], 5 + data.length); | ||
return this.comm.exchange(buffer.toString("hex"), [0x9000]).then(function (trustedInput) { | ||
return this.transport.exchange(buffer.toString("hex"), [0x9000]).then(function (trustedInput) { | ||
return trustedInput.substring(0, trustedInput.length - 4); | ||
@@ -199,3 +199,3 @@ }); | ||
buffer = Buffer.concat([buffer, transactionData], 5 + transactionData.length); | ||
return this.comm.exchange(buffer.toString("hex"), [0x9000]); | ||
return this.transport.exchange(buffer.toString("hex"), [0x9000]); | ||
} | ||
@@ -261,3 +261,3 @@ }, { | ||
}); | ||
return this.comm.exchange(buffer.toString("hex"), [0x9000]); | ||
return this.transport.exchange(buffer.toString("hex"), [0x9000]); | ||
} | ||
@@ -282,3 +282,3 @@ }, { | ||
var data = Buffer.concat([prefix, outputScript.slice(offset, offset + blockSize)]); | ||
return _this3.comm.exchange(data.toString("hex"), [0x9000]).then(function () { | ||
return _this3.transport.exchange(data.toString("hex"), [0x9000]).then(function () { | ||
offset += blockSize; | ||
@@ -315,3 +315,3 @@ }); | ||
buffer[offset++] = sigHashType; | ||
return this.comm.exchange(buffer.toString("hex"), [0x9000]).then(function (signature) { | ||
return this.transport.exchange(buffer.toString("hex"), [0x9000]).then(function (signature) { | ||
var result = Buffer.from(signature, "hex"); | ||
@@ -370,3 +370,3 @@ result[0] = 0x30; | ||
return (0, _utils.foreach)(apdus, function (apdu) { | ||
return _this4.comm.exchange(apdu, [0x9000]); | ||
return _this4.transport.exchange(apdu, [0x9000]); | ||
}).then(function () { | ||
@@ -380,3 +380,3 @@ var buffer = Buffer.alloc(6); | ||
buffer[5] = 0x00; | ||
return _this4.comm.exchange(buffer.toString("hex"), [0x9000]).then(function (apduResponse) { | ||
return _this4.transport.exchange(buffer.toString("hex"), [0x9000]).then(function (apduResponse) { | ||
var response = Buffer.from(apduResponse, "hex"); | ||
@@ -383,0 +383,0 @@ var v = response[0] - 0x30; |
{ | ||
"name": "@ledgerhq/hw-app-btc", | ||
"version": "1.0.8", | ||
"version": "1.1.0-beta.8cc6fdd9", | ||
"description": "Ledger Hardware Wallet Bitcoin Application API", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@ledgerhq/hw-transport": "^1.0.8" | ||
"@ledgerhq/hw-transport": "^1.1.0-beta.8cc6fdd9" | ||
}, | ||
@@ -39,4 +39,4 @@ "devDependencies": { | ||
"build": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --source-maps -d lib src && flow-copy-source -v src lib", | ||
"watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src" | ||
"watch": "cd ../.. && export PATH=$(yarn bin):$PATH && cd - && babel --watch --source-maps -d lib src & flow-copy-source -w -v src lib" | ||
} | ||
} |
@@ -21,3 +21,3 @@ /******************************************************************************** | ||
import { foreach, doIf, asyncWhile, splitPath, eachSeries } from "./utils"; | ||
import type LedgerComm from "@ledgerhq/hw-transport"; | ||
import type Transport from "@ledgerhq/hw-transport"; | ||
@@ -51,10 +51,10 @@ const MAX_SCRIPT_BLOCK = 50; | ||
* import Btc from "@ledgerhq/hw-app-btc"; | ||
* const btc = new Btc(comm) | ||
* const btc = new Btc(transport) | ||
*/ | ||
export default class Btc { | ||
comm: LedgerComm; | ||
transport: Transport<*>; | ||
constructor(comm: LedgerComm) { | ||
this.comm = comm; | ||
comm.setScrambleKey("BTC"); | ||
constructor(transport: Transport<*>) { | ||
this.transport = transport; | ||
transport.setScrambleKey("BTC"); | ||
} | ||
@@ -85,3 +85,3 @@ | ||
}); | ||
return this.comm | ||
return this.transport | ||
.exchange(buffer.toString("hex"), [0x9000]) | ||
@@ -135,3 +135,3 @@ .then(responseHex => { | ||
buffer = Buffer.concat([buffer, data], 5 + data.length); | ||
return this.comm | ||
return this.transport | ||
.exchange(buffer.toString("hex"), [0x9000]) | ||
@@ -249,3 +249,3 @@ .then(trustedInput => trustedInput.substring(0, trustedInput.length - 4)); | ||
); | ||
return this.comm.exchange(buffer.toString("hex"), [0x9000]); | ||
return this.transport.exchange(buffer.toString("hex"), [0x9000]); | ||
} | ||
@@ -340,3 +340,3 @@ | ||
}); | ||
return this.comm.exchange(buffer.toString("hex"), [0x9000]); | ||
return this.transport.exchange(buffer.toString("hex"), [0x9000]); | ||
} | ||
@@ -364,5 +364,7 @@ | ||
]); | ||
return this.comm.exchange(data.toString("hex"), [0x9000]).then(() => { | ||
offset += blockSize; | ||
}); | ||
return this.transport | ||
.exchange(data.toString("hex"), [0x9000]) | ||
.then(() => { | ||
offset += blockSize; | ||
}); | ||
} | ||
@@ -396,3 +398,3 @@ ); | ||
buffer[offset++] = sigHashType; | ||
return this.comm | ||
return this.transport | ||
.exchange(buffer.toString("hex"), [0x9000]) | ||
@@ -459,3 +461,3 @@ .then(signature => { | ||
} | ||
return foreach(apdus, apdu => this.comm.exchange(apdu, [0x9000])).then( | ||
return foreach(apdus, apdu => this.transport.exchange(apdu, [0x9000])).then( | ||
() => { | ||
@@ -469,3 +471,3 @@ const buffer = Buffer.alloc(6); | ||
buffer[5] = 0x00; | ||
return this.comm | ||
return this.transport | ||
.exchange(buffer.toString("hex"), [0x9000]) | ||
@@ -472,0 +474,0 @@ .then(apduResponse => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
180146
1954
1
1