diff --git a/packages/transport/package.json b/packages/transport/package.json index e212e4ce92c..5311df6d168 100644 --- a/packages/transport/package.json +++ b/packages/transport/package.json @@ -55,6 +55,7 @@ "@trezor/protobuf": "workspace:*", "@trezor/protocol": "workspace:*", "@trezor/utils": "workspace:*", + "cross-fetch": "^4.0.0", "json-stable-stringify": "^1.1.1", "long": "^4.0.0", "protobufjs": "7.2.6", diff --git a/packages/transport/src/utils/bridgeApiCall.ts b/packages/transport/src/utils/bridgeApiCall.ts index eeea611d14b..0f3544633e8 100644 --- a/packages/transport/src/utils/bridgeApiCall.ts +++ b/packages/transport/src/utils/bridgeApiCall.ts @@ -1,3 +1,5 @@ +import fetch from 'cross-fetch'; + import { success, error, unknownError } from './result'; import * as ERRORS from '../errors'; diff --git a/packages/trezor-user-env-link/package.json b/packages/trezor-user-env-link/package.json index 8757fe81e59..e0663ec32c4 100644 --- a/packages/trezor-user-env-link/package.json +++ b/packages/trezor-user-env-link/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@trezor/utils": "workspace:*", + "cross-fetch": "^4.0.0", "ws": "^8.16.0" } } diff --git a/packages/trezor-user-env-link/src/websocket-client.ts b/packages/trezor-user-env-link/src/websocket-client.ts index e351a252398..cf753de6205 100644 --- a/packages/trezor-user-env-link/src/websocket-client.ts +++ b/packages/trezor-user-env-link/src/websocket-client.ts @@ -2,6 +2,7 @@ import WebSocket from 'ws'; import { EventEmitter } from 'events'; +import fetch from 'cross-fetch'; import { createDeferred, Deferred } from '@trezor/utils'; diff --git a/yarn.lock b/yarn.lock index b3cade4346d..ab2c4020ca3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10561,6 +10561,7 @@ __metadata: "@types/bytebuffer": "npm:^5.0.48" "@types/sharedworker": "npm:^0.0.111" "@types/w3c-web-usb": "npm:^1.0.10" + cross-fetch: "npm:^4.0.0" jest: "npm:29.7.0" json-stable-stringify: "npm:^1.1.1" long: "npm:^4.0.0" @@ -10578,6 +10579,7 @@ __metadata: resolution: "@trezor/trezor-user-env-link@workspace:packages/trezor-user-env-link" dependencies: "@trezor/utils": "workspace:*" + cross-fetch: "npm:^4.0.0" ws: "npm:^8.16.0" languageName: unknown linkType: soft