Socket
Socket
Sign inDemoInstall

@ledgerhq/hw-transport-http

Package Overview
Dependencies
Maintainers
6
Versions
382
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledgerhq/hw-transport-http - npm Package Compare versions

Comparing version 2.0.5 to 2.1.0

flow-typed/npm/@ledgerhq/hw-transport_vx.x.x.js

4

lib/HttpTransport.js

@@ -33,3 +33,3 @@ "use strict";

if (response.status !== 200) {
throw new Error("failed to access HttpTransport(" + url + "): status " + response.status);
throw new _hwTransport.TransportError("failed to access HttpTransport(" + url + "): status " + response.status, "HttpTransportNotAccessible");
}

@@ -67,3 +67,3 @@ return new HttpTransport(url);

if (response.status !== 200) {
throw "failed to communicate to server. code=" + response.status;
throw new _hwTransport.TransportError("failed to communicate to server. code=" + response.status, "HttpTransportStatus" + response.status);
}

@@ -70,0 +70,0 @@ const body = yield response.json();

@@ -26,3 +26,2 @@ "use strict";

if (unsubscribed) return;
// $FlowFixMe wtf flow
observer.next({ type: "add", descriptor: url });

@@ -29,0 +28,0 @@ observer.complete();

{
"name": "@ledgerhq/hw-transport-http",
"version": "2.0.5",
"version": "2.1.0",
"description": "Ledger Hardware Wallet communication layer over http",

@@ -28,3 +28,3 @@ "keywords": [

"dependencies": {
"@ledgerhq/hw-transport": "^2.0.5"
"@ledgerhq/hw-transport": "^2.1.0"
},

@@ -31,0 +31,0 @@ "devDependencies": {

//@flow
import Transport from "@ledgerhq/hw-transport";
import Transport, { TransportError } from "@ledgerhq/hw-transport";
import withStaticURL from "./withStaticURL";

@@ -20,4 +20,8 @@ export { withStaticURL };

if (response.status !== 200) {
throw new Error(
"failed to access HttpTransport(" + url + "): status " + response.status
throw new TransportError(
"failed to access HttpTransport(" +
url +
"): status " +
response.status,
"HttpTransportNotAccessible"
);

@@ -54,3 +58,6 @@ }

if (response.status !== 200) {
throw "failed to communicate to server. code=" + response.status;
throw new TransportError(
"failed to communicate to server. code=" + response.status,
"HttpTransportStatus" + response.status
);
}

@@ -57,0 +64,0 @@ const body = await response.json();

// @flow
import HttpTransport from "./HttpTransport";
import type {
Observer,
DescriptorEvent,
Subscription
} from "@ledgerhq/hw-transport";
export default (urlArg: ?string): Class<HttpTransport> => {

@@ -7,4 +13,8 @@ const url = urlArg;

class StaticHttpTransport extends HttpTransport {
static list = (): * => HttpTransport.open(url).then(() => [url], () => []);
static listen = (observer: *) => {
static list = (): Promise<string[]> =>
HttpTransport.open(url).then(() => [url], () => []);
static listen = (
observer: Observer<DescriptorEvent<string>>
): Subscription => {
let unsubscribed = false;

@@ -16,3 +26,2 @@ function attemptToConnect() {

if (unsubscribed) return;
// $FlowFixMe wtf flow
observer.next({ type: "add", descriptor: url });

@@ -19,0 +28,0 @@ observer.complete();

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc