@ledgerhq/hw-transport-node-speculos-http
Advanced tools
Comparing version 6.27.15 to 6.27.16-nightly.0
# @ledgerhq/hw-transport-node-speculos-http | ||
## 6.27.16-nightly.0 | ||
### Patch Changes | ||
- Updated dependencies [[`9adc1862dd`](https://github.com/LedgerHQ/ledger-live/commit/9adc1862dda605a722d19f3b6895bd324834c914)]: | ||
- @ledgerhq/errors@6.12.7-nightly.0 | ||
- @ledgerhq/hw-transport@6.28.5-nightly.0 | ||
## 6.27.15 | ||
@@ -4,0 +12,0 @@ |
@@ -49,6 +49,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
.post(`/button/${input}`, { action: "press-and-release" }) | ||
.then((response) => { | ||
.then(response => { | ||
resolve(response.data); | ||
}) | ||
.catch((e) => { | ||
.catch(e => { | ||
reject(e); | ||
@@ -64,3 +64,3 @@ }); | ||
log("apdu", "=> " + hex); | ||
return this.instance.post("/apdu", { data: hex }).then((r) => { | ||
return this.instance.post("/apdu", { data: hex }).then(r => { | ||
// r.data is {"data": "hex value of response"} | ||
@@ -97,4 +97,4 @@ const data = r.data.data; | ||
}) | ||
.then((response) => { | ||
response.data.on("data", (chunk) => { | ||
.then(response => { | ||
response.data.on("data", chunk => { | ||
log("speculos-event", chunk.toString()); | ||
@@ -113,3 +113,3 @@ const split = chunk.toString().replace("data: ", ""); | ||
}) | ||
.catch((error) => { | ||
.catch(error => { | ||
reject(error); | ||
@@ -116,0 +116,0 @@ }); |
@@ -54,6 +54,6 @@ "use strict"; | ||
.post(`/button/${input}`, { action: "press-and-release" }) | ||
.then((response) => { | ||
.then(response => { | ||
resolve(response.data); | ||
}) | ||
.catch((e) => { | ||
.catch(e => { | ||
reject(e); | ||
@@ -69,3 +69,3 @@ }); | ||
(0, logs_1.log)("apdu", "=> " + hex); | ||
return this.instance.post("/apdu", { data: hex }).then((r) => { | ||
return this.instance.post("/apdu", { data: hex }).then(r => { | ||
// r.data is {"data": "hex value of response"} | ||
@@ -103,4 +103,4 @@ const data = r.data.data; | ||
}) | ||
.then((response) => { | ||
response.data.on("data", (chunk) => { | ||
.then(response => { | ||
response.data.on("data", chunk => { | ||
(0, logs_1.log)("speculos-event", chunk.toString()); | ||
@@ -119,3 +119,3 @@ const split = chunk.toString().replace("data: ", ""); | ||
}) | ||
.catch((error) => { | ||
.catch(error => { | ||
reject(error); | ||
@@ -122,0 +122,0 @@ }); |
{ | ||
"name": "@ledgerhq/hw-transport-node-speculos-http", | ||
"version": "6.27.15", | ||
"version": "6.27.16-nightly.0", | ||
"description": "Ledger Hardware Wallet communication layer with speculos Nano simulator using the http api", | ||
@@ -33,4 +33,4 @@ "keywords": [ | ||
"rxjs": "6", | ||
"@ledgerhq/errors": "^6.12.6", | ||
"@ledgerhq/hw-transport": "^6.28.4", | ||
"@ledgerhq/errors": "^6.12.7-nightly.0", | ||
"@ledgerhq/hw-transport": "^6.28.5-nightly.0", | ||
"@ledgerhq/logs": "^6.10.1" | ||
@@ -55,3 +55,3 @@ }, | ||
"doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts", | ||
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx", | ||
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache", | ||
"lint:fix": "pnpm lint --fix", | ||
@@ -58,0 +58,0 @@ "test": "jest" |
@@ -53,5 +53,3 @@ import axios from "axios"; | ||
static open = ( | ||
opts: SpeculosHttpTransportOpts | ||
): Promise<SpeculosHttpTransport> => | ||
static open = (opts: SpeculosHttpTransportOpts): Promise<SpeculosHttpTransport> => | ||
new Promise((resolve, reject) => { | ||
@@ -69,4 +67,4 @@ const instance = axios.create({ | ||
}) | ||
.then((response) => { | ||
response.data.on("data", (chunk) => { | ||
.then(response => { | ||
response.data.on("data", chunk => { | ||
log("speculos-event", chunk.toString()); | ||
@@ -79,6 +77,3 @@ const split = chunk.toString().replace("data: ", ""); | ||
log("speculos-event", "close"); | ||
transport.emit( | ||
"disconnect", | ||
new DisconnectedDevice("Speculos exited!") | ||
); | ||
transport.emit("disconnect", new DisconnectedDevice("Speculos exited!")); | ||
}); | ||
@@ -89,3 +84,3 @@ transport.eventStream = response.data; | ||
}) | ||
.catch((error) => { | ||
.catch(error => { | ||
reject(error); | ||
@@ -106,6 +101,6 @@ }); | ||
.post(`/button/${input}`, { action: "press-and-release" }) | ||
.then((response) => { | ||
.then(response => { | ||
resolve(response.data); | ||
}) | ||
.catch((e) => { | ||
.catch(e => { | ||
reject(e); | ||
@@ -118,3 +113,3 @@ }); | ||
log("apdu", "=> " + hex); | ||
return this.instance.post("/apdu", { data: hex }).then((r) => { | ||
return this.instance.post("/apdu", { data: hex }).then(r => { | ||
// r.data is {"data": "hex value of response"} | ||
@@ -121,0 +116,0 @@ const data = r.data.data; |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
37041
439
1