Skip to content

Commit

Permalink
fix: remove @ledgerhq/hw-transport-http that uses an old axios vers…
Browse files Browse the repository at this point in the history
…ion (#317)
  • Loading branch information
Justkant authored Feb 20, 2024
1 parent 6883a33 commit 50f0d3e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 66 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-boats-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/wallet-api-simulator": patch
---

fix: remove `@ledgerhq/hw-transport-http` that uses an old axios version
1 change: 0 additions & 1 deletion packages/simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
},
"dependencies": {
"@ledgerhq/hw-transport": "^6.30.4",
"@ledgerhq/hw-transport-http": "^6.29.4",
"@ledgerhq/wallet-api-client": "workspace:*",
"@ledgerhq/wallet-api-core": "workspace:*",
"@ledgerhq/wallet-api-server": "workspace:*",
Expand Down
23 changes: 6 additions & 17 deletions packages/simulator/src/profiles/device/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import type HWTransport from "@ledgerhq/hw-transport";
import TransportHttp from "@ledgerhq/hw-transport-http";
import HWTransport from "@ledgerhq/hw-transport";
import type { SimulatorProfile } from "../../types";
import { standardProfile } from "../standard";

export const deviceProfile: (deviceProxyUrl?: string) => SimulatorProfile = (
deviceProxyUrl,
) => {
const httpTransport = deviceProxyUrl
? TransportHttp(deviceProxyUrl.split("|"))
: undefined;

export const deviceProfile: (
mainTransport: typeof HWTransport,
) => SimulatorProfile = (mainTransport) => {
let transport: HWTransport | undefined;

return {
Expand All @@ -28,24 +23,18 @@ export const deviceProfile: (deviceProxyUrl?: string) => SimulatorProfile = (
methods: {
...standardProfile.methods,
"device.transport": async () => {
if (!httpTransport) {
throw new Error("Proxy not setup");
}
if (transport) {
throw new Error("Transport already opened");
}
transport = await httpTransport.create(3000, 5000);
transport = await mainTransport.create(3000, 5000);
return "1";
},
"device.select": () => "",
"device.open": async () => {
if (!httpTransport) {
throw new Error("Proxy not setup");
}
if (transport) {
throw new Error("Transport already opened");
}
transport = await httpTransport.create(3000, 5000);
transport = await mainTransport.create(3000, 5000);
return "1";
},
"device.exchange": async ({ apduHex, transportId }) => {
Expand Down
48 changes: 0 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 50f0d3e

Please sign in to comment.