@trezor/connect 9.0.5 → 9.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 9.0.6
2
+
3
+ - fix: list tslib as direct dependency
4
+ - fix: various improvement and fixes regarding RBF (https://github.com/trezor/trezor-suite/pull/7378)
5
+ - change: increase handshake timeout in popup to 90 seconds
6
+ - change: TrezorConnect.dispose is now async and resolves only after connected device is released
7
+
1
8
  # 9.0.5
2
9
 
3
10
  - added: analytics in popup
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @trezor/connect
2
2
 
3
- API version 9.0.5
3
+ API version 9.0.6
4
4
 
5
5
  [![Build Status](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml/badge.svg)](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
6
6
  [![NPM](https://img.shields.io/npm/v/@trezor/connect.svg)](https://www.npmjs.org/package/@trezor/connect)
@@ -161,7 +161,7 @@ exports.transformReferencedTransactions = transformReferencedTransactions;
161
161
  const validateReferencedTransactions = (txs, inputs, outputs) => {
162
162
  if (!Array.isArray(txs) || txs.length === 0)
163
163
  return;
164
- const refTxs = (0, exports.getReferencedTransactions)(inputs);
164
+ const refTxs = (0, exports.requireReferencedTransactions)(inputs) ? (0, exports.getReferencedTransactions)(inputs) : [];
165
165
  const origTxs = (0, exports.getOrigTransactions)(inputs, outputs);
166
166
  const transformedTxs = txs.map(tx => {
167
167
  (0, paramsValidator_1.validateParams)(tx, [
@@ -28,7 +28,9 @@ class CheckFirmwareAuthenticity extends AbstractMethod_1.AbstractMethod {
28
28
  throw constants_1.ERRORS.TypedError('Runtime', 'checkFirmwareAuthenticity: firmware binary not found');
29
29
  }
30
30
  const { hash: expectedFirmwareHash, challenge } = (0, firmware_1.calculateFirmwareHash)(device.features.major_version, (0, firmware_1.stripFwHeaders)(fw), (0, randombytes_1.default)(32));
31
- const result = await this.device.commands.typedCall('GetFirmwareHash', 'FirmwareHash', {
31
+ const result = await this.device
32
+ .getCommands()
33
+ .typedCall('GetFirmwareHash', 'FirmwareHash', {
32
34
  challenge,
33
35
  });
34
36
  const { message } = result;
@@ -16,6 +16,8 @@ type Params = {
16
16
  };
17
17
  export default class SignTransaction extends AbstractMethod<'signTransaction', Params> {
18
18
  init(): void;
19
+ private fetchAddresses;
20
+ private fetchRefTxs;
19
21
  run(): Promise<import("../types").SignedTransaction>;
20
22
  }
21
23
  export {};
@@ -85,46 +85,49 @@ class SignTransaction extends AbstractMethod_1.AbstractMethod {
85
85
  };
86
86
  this.params.options = (0, bitcoin_1.enhanceSignTx)(this.params.options, coinInfo);
87
87
  }
88
- async run() {
89
- const { device, params } = this;
90
- let refTxs = [];
91
- const useLegacySignProcess = device.unavailableCapabilities.replaceTransaction;
92
- if (!params.refTxs) {
93
- const requiredRefTxs = (0, bitcoin_1.requireReferencedTransactions)(params.inputs, params.options, params.coinInfo);
94
- const refTxsIds = (0, bitcoin_1.getReferencedTransactions)(params.inputs);
95
- if (requiredRefTxs && refTxsIds.length > 0) {
96
- (0, BlockchainLink_1.isBackendSupported)(params.coinInfo);
97
- const blockchain = await (0, BlockchainLink_1.initBlockchain)(params.coinInfo, this.postMessage);
98
- const rawTxs = await blockchain.getTransactions(refTxsIds);
99
- (0, bitcoin_1.enhanceTrezorInputs)(this.params.inputs, rawTxs);
100
- refTxs = (0, bitcoin_1.transformReferencedTransactions)(rawTxs, params.coinInfo);
101
- const origTxsIds = (0, bitcoin_1.getOrigTransactions)(params.inputs, params.outputs);
102
- if (!useLegacySignProcess && origTxsIds.length > 0) {
103
- const rawOrigTxs = await blockchain.getTransactions(origTxsIds);
104
- let { addresses } = params;
105
- if (!addresses) {
106
- const accountPath = params.inputs.find(i => i.address_n);
107
- if (!accountPath || !accountPath.address_n) {
108
- throw constants_1.ERRORS.TypedError('Runtime', 'Account not found');
109
- }
110
- const address_n = accountPath.address_n.slice(0, 3);
111
- const node = await device
112
- .getCommands()
113
- .getHDNode({ address_n }, { coinInfo: params.coinInfo });
114
- const account = await blockchain.getAccountInfo({
115
- descriptor: node.xpubSegwit || node.xpub,
116
- details: 'tokens',
117
- });
118
- addresses = account.addresses;
119
- }
120
- const origRefTxs = (0, bitcoin_1.transformOrigTransactions)(rawOrigTxs, params.coinInfo, addresses);
121
- refTxs = refTxs.concat(origRefTxs);
122
- }
123
- }
88
+ async fetchAddresses(blockchain) {
89
+ const { device, params: { inputs, coinInfo }, } = this;
90
+ const accountPath = inputs.find(i => i.address_n);
91
+ if (!accountPath || !accountPath.address_n) {
92
+ throw constants_1.ERRORS.TypedError('Runtime', 'Account not found');
124
93
  }
125
- else {
126
- refTxs = params.refTxs;
94
+ const address_n = accountPath.address_n.slice(0, 3);
95
+ const node = await device.getCommands().getHDNode({ address_n }, { coinInfo });
96
+ const account = await blockchain.getAccountInfo({
97
+ descriptor: node.xpubSegwit || node.xpub,
98
+ details: 'tokens',
99
+ });
100
+ return account.addresses;
101
+ }
102
+ async fetchRefTxs(useLegacySignProcess) {
103
+ const { params: { inputs, outputs, options, coinInfo, addresses }, } = this;
104
+ const requiredRefTxs = (0, bitcoin_1.requireReferencedTransactions)(inputs, options, coinInfo);
105
+ const refTxsIds = requiredRefTxs ? (0, bitcoin_1.getReferencedTransactions)(inputs) : [];
106
+ const origTxsIds = !useLegacySignProcess ? (0, bitcoin_1.getOrigTransactions)(inputs, outputs) : [];
107
+ if (!refTxsIds.length && !origTxsIds.length) {
108
+ return [];
127
109
  }
110
+ (0, BlockchainLink_1.isBackendSupported)(coinInfo);
111
+ const blockchain = await (0, BlockchainLink_1.initBlockchain)(coinInfo, this.postMessage);
112
+ const refTxs = !refTxsIds.length
113
+ ? []
114
+ : await blockchain.getTransactions(refTxsIds).then(rawTxs => {
115
+ (0, bitcoin_1.enhanceTrezorInputs)(this.params.inputs, rawTxs);
116
+ return (0, bitcoin_1.transformReferencedTransactions)(rawTxs, coinInfo);
117
+ });
118
+ const origTxs = !origTxsIds.length
119
+ ? []
120
+ : await blockchain.getTransactions(origTxsIds).then(async (rawOrigTxs) => {
121
+ const accountAddresses = addresses !== null && addresses !== void 0 ? addresses : (await this.fetchAddresses(blockchain));
122
+ return (0, bitcoin_1.transformOrigTransactions)(rawOrigTxs, coinInfo, accountAddresses);
123
+ });
124
+ return refTxs.concat(origTxs);
125
+ }
126
+ async run() {
127
+ var _a;
128
+ const { device, params } = this;
129
+ const useLegacySignProcess = !!device.unavailableCapabilities.replaceTransaction;
130
+ const refTxs = (_a = params.refTxs) !== null && _a !== void 0 ? _a : (await this.fetchRefTxs(useLegacySignProcess));
128
131
  if (this.preauthorized) {
129
132
  await device.getCommands().preauthorize(true);
130
133
  }
@@ -6,7 +6,7 @@ export declare const handleMessage: (message: CoreMessage, isTrustedOrigin?: boo
6
6
  export declare const onCall: (message: CoreMessage) => Promise<void>;
7
7
  export declare class Core extends EventEmitter {
8
8
  handleMessage(message: any, isTrustedOrigin: boolean): void;
9
- dispose(): void;
9
+ dispose(): Promise<void>;
10
10
  getCurrentMethod(): (import("../api").applyFlags | import("../api").applySettings | import("../api").authorizeCoinJoin | import("../api").backupDevice | import("../api").binanceGetAddress | import("../api").binanceGetPublicKey | import("../api").binanceSignTransaction | import("../api").blockchainDisconnect | import("../api").blockchainEstimateFee | import("../api").blockchainGetAccountBalanceHistory | import("../api").blockchainGetCurrentFiatRates | import("../api").blockchainGetFiatRatesForTimestamps | import("../api").blockchainGetTransactions | import("../api").blockchainSetCustomBackend | import("../api").blockchainSubscribe | import("../api").blockchainSubscribeFiatRates | import("../api").blockchainUnsubscribe | import("../api").blockchainUnsubscribeFiatRates | import("../api").cardanoGetAddress | import("../api").cardanoGetNativeScriptHash | import("../api").cardanoGetPublicKey | import("../api").cardanoSignTransaction | import("../api").changePin | import("../api").cipherKeyValue | import("../api").composeTransaction | import("../api").eosGetPublicKey | import("../api").eosSignTransaction | import("../api").ethereumGetAddress | import("../api").ethereumGetPublicKey | import("../api").ethereumSignMessage | import("../api").ethereumSignTransaction | import("../api").ethereumSignTypedData | import("../api").ethereumVerifyMessage | import("../api").firmwareUpdate | import("../api").getAccountInfo | import("../api").getAddress | import("../api").getCoinInfo | import("../api").getDeviceState | import("../api").getFeatures | import("../api").getFirmwareHash | import("../api").getOwnershipId | import("../api").getOwnershipProof | import("../api").getPublicKey | import("../api").getSettings | import("../api").nemGetAddress | import("../api").nemSignTransaction | import("../api").pushTransaction | import("../api").rebootToBootloader | import("../api").recoveryDevice | import("../api").requestLogin | import("../api").resetDevice | import("../api").rippleGetAddress | import("../api").rippleSignTransaction | import("../api").setBusy | import("../api").setProxy | import("../api").signMessage | import("../api").signTransaction | import("../api").stellarGetAddress | import("../api").stellarSignTransaction | import("../api").tezosGetAddress | import("../api").tezosGetPublicKey | import("../api").tezosSignTransaction | import("../api").unlockPath | import("../api").verifyMessage | import("../api").wipeDevice | import("../api").checkFirmwareAuthenticity)[];
11
11
  getTransportInfo(): TransportInfo;
12
12
  }
package/lib/core/index.js CHANGED
@@ -74,6 +74,8 @@ const handleMessage = (message, isTrustedOrigin = false) => {
74
74
  case events_2.TRANSPORT.DISABLE_WEBUSB:
75
75
  disableWebUSBTransport();
76
76
  break;
77
+ case events_2.TRANSPORT.REQUEST_DEVICE:
78
+ break;
77
79
  case events_2.UI.RECEIVE_DEVICE:
78
80
  case events_2.UI.RECEIVE_CONFIRMATION:
79
81
  case events_2.UI.RECEIVE_PERMISSION:
@@ -587,12 +589,12 @@ class Core extends events_1.default {
587
589
  handleMessage(message, isTrustedOrigin) {
588
590
  (0, exports.handleMessage)(message, isTrustedOrigin);
589
591
  }
590
- dispose() {
591
- if (_deviceList) {
592
- _deviceList.dispose();
593
- }
592
+ async dispose() {
594
593
  (0, BlockchainLink_1.dispose)();
595
594
  this.removeAllListeners();
595
+ if (_deviceList) {
596
+ await _deviceList.dispose();
597
+ }
596
598
  }
597
599
  getCurrentMethod() {
598
600
  return _callMethods;
@@ -651,7 +653,7 @@ const disableWebUSBTransport = async () => {
651
653
  const settings = DataManager_1.DataManager.getSettings();
652
654
  settings.webusb = false;
653
655
  try {
654
- _deviceList.dispose();
656
+ await _deviceList.dispose();
655
657
  await initDeviceList(settings);
656
658
  }
657
659
  catch (error) {
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.config = void 0;
4
+ const transport_1 = require("@trezor/transport");
4
5
  exports.config = {
5
- webusb: [
6
- { vendorId: 0x534c, productId: 0x0001 },
7
- { vendorId: 0x1209, productId: 0x53c0 },
8
- { vendorId: 0x1209, productId: 0x53c1 },
9
- ],
6
+ webusb: transport_1.TREZOR_DESCS,
10
7
  whitelist: [
11
8
  { origin: 'chrome-extension://imloifkgjagghnncjkhggdhalmcnfklk', priority: 1 },
12
9
  { origin: 'chrome-extension://niebkpllfhmpfbffbfifagfgoamhpflf', priority: 1 },
@@ -1,3 +1,3 @@
1
- export declare const VERSION = "9.0.5";
1
+ export declare const VERSION = "9.0.6";
2
2
  export declare const DEFAULT_DOMAIN: string;
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
4
- exports.VERSION = '9.0.5';
4
+ exports.VERSION = '9.0.6';
5
5
  const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
6
6
  exports.DEFAULT_DOMAIN = `https://connect.trezor.io/${versionN[0]}/`;
7
7
  //# sourceMappingURL=version.js.map
@@ -44,7 +44,7 @@ export declare class Device extends EventEmitter {
44
44
  inconsistent: boolean;
45
45
  firstRunPromise: Deferred<boolean>;
46
46
  activitySessionID?: string | null;
47
- commands: DeviceCommands;
47
+ commands?: DeviceCommands;
48
48
  keepSession: boolean;
49
49
  instance: number;
50
50
  internalState: string[];
@@ -93,7 +93,7 @@ export declare class Device extends EventEmitter {
93
93
  getDevicePath(): string;
94
94
  isT1(): boolean;
95
95
  hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
96
- dispose(): void;
96
+ dispose(): Promise<void> | undefined;
97
97
  getMode(): "normal" | "bootloader" | "initialize" | "seedless";
98
98
  toMessageObject(): DeviceTyped;
99
99
  _getNetworkTypeState(): "bitcoin" | "ethereum" | "nem" | "eos" | "stellar" | "cardano" | "ripple" | "tezos" | "binance";
@@ -152,7 +152,8 @@ class Device extends events_1.default {
152
152
  }
153
153
  }
154
154
  async _runInner(fn, options) {
155
- if (!this.isUsedHere() || this.commands.disposed || !this.getExternalState()) {
155
+ var _a;
156
+ if (!this.isUsedHere() || ((_a = this.commands) === null || _a === void 0 ? void 0 : _a.disposed) || !this.getExternalState()) {
156
157
  await this.acquire();
157
158
  try {
158
159
  if (fn) {
@@ -201,6 +202,9 @@ class Device extends events_1.default {
201
202
  }
202
203
  }
203
204
  getCommands() {
205
+ if (!this.commands) {
206
+ throw constants_1.ERRORS.TypedError('Runtime', `Device: commands not defined`);
207
+ }
204
208
  return this.commands;
205
209
  }
206
210
  setInstance(instance = 0) {
@@ -245,13 +249,13 @@ class Device extends events_1.default {
245
249
  if (!this.features)
246
250
  return;
247
251
  if (!this.features.unlocked && preauthorized) {
248
- if (await this.commands.preauthorize(false)) {
252
+ if (await this.getCommands().preauthorize(false)) {
249
253
  return;
250
254
  }
251
255
  }
252
256
  const altMode = this._altModeChange(networkType);
253
257
  const expectedState = altMode ? undefined : this.getExternalState();
254
- const state = await this.commands.getDeviceState(networkType);
258
+ const state = await this.getCommands().getDeviceState(networkType);
255
259
  const uniqueState = `${state}@${this.features.device_id || 'device_id'}:${this.instance}`;
256
260
  if (!this.useLegacyPassphrase() && this.features.session_id) {
257
261
  this.setInternalState(this.features.session_id);
@@ -284,11 +288,11 @@ class Device extends events_1.default {
284
288
  }
285
289
  }
286
290
  }
287
- const { message } = await this.commands.typedCall('Initialize', 'Features', payload);
291
+ const { message } = await this.getCommands().typedCall('Initialize', 'Features', payload);
288
292
  this._updateFeatures(message);
289
293
  }
290
294
  async getFeatures() {
291
- const { message } = await this.commands.typedCall('GetFeatures', 'Features', {});
295
+ const { message } = await this.getCommands().typedCall('GetFeatures', 'Features', {});
292
296
  this._updateFeatures(message);
293
297
  }
294
298
  _updateFeatures(feat) {
@@ -452,7 +456,7 @@ class Device extends events_1.default {
452
456
  if (this.commands) {
453
457
  this.commands.cancel();
454
458
  }
455
- this.transport.release(this.activitySessionID, true, false);
459
+ return this.transport.release(this.activitySessionID, true);
456
460
  }
457
461
  catch (err) {
458
462
  }
@@ -60,7 +60,7 @@ export declare class DeviceList extends EventEmitter {
60
60
  length(): number;
61
61
  transportType(): string;
62
62
  getTransportInfo(): TransportInfo;
63
- dispose(): void;
63
+ dispose(): Promise<void>;
64
64
  disconnectDevices(): void;
65
65
  enumerate(): void;
66
66
  addAuthPenalty(device: Device): void;
@@ -173,11 +173,12 @@ class DeviceList extends events_1.default {
173
173
  outdated: this.transport.isOutdated,
174
174
  };
175
175
  }
176
- dispose() {
176
+ async dispose() {
177
177
  this.removeAllListeners();
178
178
  if (this.stream) {
179
179
  this.stream.stop();
180
180
  }
181
+ await Promise.all(this.allDevices().map(device => device.dispose()));
181
182
  if (this.transport) {
182
183
  this.transport.stop();
183
184
  }
@@ -185,7 +186,6 @@ class DeviceList extends events_1.default {
185
186
  this.fetchController.abort();
186
187
  this.fetchController = null;
187
188
  }
188
- this.allDevices().forEach(device => device.dispose());
189
189
  }
190
190
  disconnectDevices() {
191
191
  this.allDevices().forEach(device => {
@@ -5,7 +5,7 @@ export declare const TRANSPORT: {
5
5
  readonly ERROR: "transport-error";
6
6
  readonly UPDATE: "transport-update";
7
7
  readonly STREAM: "transport-stream";
8
- readonly REQUEST: "transport-request_device";
8
+ readonly REQUEST_DEVICE: "transport-request_device";
9
9
  readonly DISABLE_WEBUSB: "transport-disable_webusb";
10
10
  readonly START_PENDING: "transport-start_pending";
11
11
  };
@@ -54,6 +54,10 @@ export interface TransportDisableWebUSB {
54
54
  type: typeof TRANSPORT.DISABLE_WEBUSB;
55
55
  payload?: undefined;
56
56
  }
57
+ export interface TransportRequestWebUSBDevice {
58
+ type: typeof TRANSPORT.REQUEST_DEVICE;
59
+ payload?: undefined;
60
+ }
57
61
  export type TransportEventMessage = TransportEvent & {
58
62
  event: typeof TRANSPORT_EVENT;
59
63
  };
@@ -8,7 +8,7 @@ exports.TRANSPORT = {
8
8
  ERROR: 'transport-error',
9
9
  UPDATE: 'transport-update',
10
10
  STREAM: 'transport-stream',
11
- REQUEST: 'transport-request_device',
11
+ REQUEST_DEVICE: 'transport-request_device',
12
12
  DISABLE_WEBUSB: 'transport-disable_webusb',
13
13
  START_PENDING: 'transport-start_pending',
14
14
  };
@@ -1,6 +1,6 @@
1
1
  import type { EventTypeDeviceSelected } from '@trezor/connect-analytics';
2
2
  import type { PROTO } from '../constants';
3
- import type { TransportDisableWebUSB } from './transport';
3
+ import type { TransportDisableWebUSB, TransportRequestWebUSBDevice } from './transport';
4
4
  import type { Device, CoinInfo, BitcoinNetworkInfo } from '../types';
5
5
  import type { DiscoveryAccountType, DiscoveryAccount, SelectFeeLevel } from '../types/account';
6
6
  import type { MessageFactoryFn } from '../types/utils';
@@ -200,7 +200,7 @@ export interface FirmwareProgress {
200
200
  progress: number;
201
201
  };
202
202
  }
203
- export type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPermission | UiRequestConfirmation | UiRequestSelectDevice | UiRequestUnexpectedDeviceMode | UiRequestSelectAccount | UiRequestSelectFee | UpdateCustomFee | BundleProgress<any> | FirmwareProgress | FirmwareException | UiRequestAddressValidation | UiRequestSetOperation | TransportDisableWebUSB;
203
+ export type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPermission | UiRequestConfirmation | UiRequestSelectDevice | UiRequestUnexpectedDeviceMode | UiRequestSelectAccount | UiRequestSelectFee | UpdateCustomFee | BundleProgress<any> | FirmwareProgress | FirmwareException | UiRequestAddressValidation | UiRequestSetOperation | TransportDisableWebUSB | TransportRequestWebUSBDevice;
204
204
  export type UiEventMessage = UiEvent & {
205
205
  event: typeof UI_EVENT;
206
206
  };
package/lib/factory.d.ts CHANGED
@@ -11,9 +11,10 @@ interface Dependencies {
11
11
  uiResponse: TrezorConnect['uiResponse'];
12
12
  renderWebUSBButton: TrezorConnect['renderWebUSBButton'];
13
13
  disableWebUSB: TrezorConnect['disableWebUSB'];
14
+ requestWebUSBDevice: TrezorConnect['requestWebUSBDevice'];
14
15
  cancel: TrezorConnect['cancel'];
15
16
  dispose: TrezorConnect['dispose'];
16
17
  }
17
- export declare const factory: ({ eventEmitter, manifest, init, call, requestLogin, uiResponse, renderWebUSBButton, disableWebUSB, cancel, dispose, }: Dependencies) => TrezorConnect;
18
+ export declare const factory: ({ eventEmitter, manifest, init, call, requestLogin, uiResponse, renderWebUSBButton, disableWebUSB, requestWebUSBDevice, cancel, dispose, }: Dependencies) => TrezorConnect;
18
19
  export {};
19
20
  //# sourceMappingURL=factory.d.ts.map
package/lib/factory.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.factory = void 0;
4
4
  const events_1 = require("./events");
5
- const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse, renderWebUSBButton, disableWebUSB, cancel, dispose, }) => {
5
+ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse, renderWebUSBButton, disableWebUSB, requestWebUSBDevice, cancel, dispose, }) => {
6
6
  const api = {
7
7
  manifest,
8
8
  init,
@@ -123,6 +123,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
123
123
  cancel,
124
124
  renderWebUSBButton,
125
125
  disableWebUSB,
126
+ requestWebUSBDevice,
126
127
  };
127
128
  return api;
128
129
  };
@@ -17,6 +17,7 @@ const TrezorConnect = (0, factory_1.factory)({
17
17
  init: fallback,
18
18
  call: fallback,
19
19
  requestLogin: fallback,
20
+ requestWebUSBDevice: fallback,
20
21
  uiResponse: fallback,
21
22
  renderWebUSBButton: fallback,
22
23
  disableWebUSB: fallback,
package/lib/index.js CHANGED
@@ -22,11 +22,11 @@ const manifest = (data) => {
22
22
  manifest: data,
23
23
  });
24
24
  };
25
- const dispose = () => {
25
+ const dispose = async () => {
26
26
  exports.eventEmitter.removeAllListeners();
27
27
  _settings = (0, connectSettings_1.parseConnectSettings)();
28
28
  if (_core) {
29
- _core.dispose();
29
+ await _core.dispose();
30
30
  _core = null;
31
31
  }
32
32
  };
@@ -186,6 +186,9 @@ const renderWebUSBButton = (_className) => {
186
186
  const disableWebUSB = () => {
187
187
  throw constants_1.ERRORS.TypedError('Method_InvalidPackage');
188
188
  };
189
+ const requestWebUSBDevice = () => {
190
+ throw constants_1.ERRORS.TypedError('Method_InvalidPackage');
191
+ };
189
192
  const TrezorConnect = (0, factory_1.factory)({
190
193
  eventEmitter: exports.eventEmitter,
191
194
  manifest,
@@ -195,6 +198,7 @@ const TrezorConnect = (0, factory_1.factory)({
195
198
  uiResponse,
196
199
  renderWebUSBButton,
197
200
  disableWebUSB,
201
+ requestWebUSBDevice,
198
202
  cancel,
199
203
  dispose,
200
204
  });
@@ -1,2 +1,2 @@
1
- export declare function dispose(): void;
1
+ export declare function dispose(): Promise<void>;
2
2
  //# sourceMappingURL=dispose.d.ts.map
@@ -57,6 +57,7 @@ import { recoveryDevice } from './recoveryDevice';
57
57
  import { removeAllListeners } from './removeAllListeners';
58
58
  import { renderWebUSBButton } from './renderWebUSBButton';
59
59
  import { requestLogin } from './requestLogin';
60
+ import { requestWebUSBDevice } from './requestWebUSBDevice';
60
61
  import { resetDevice } from './resetDevice';
61
62
  import { rippleGetAddress } from './rippleGetAddress';
62
63
  import { rippleSignTransaction } from './rippleSignTransaction';
@@ -102,6 +103,7 @@ export interface TrezorConnect {
102
103
  cipherKeyValue: typeof cipherKeyValue;
103
104
  composeTransaction: typeof composeTransaction;
104
105
  disableWebUSB: typeof disableWebUSB;
106
+ requestWebUSBDevice: typeof requestWebUSBDevice;
105
107
  dispose: typeof dispose;
106
108
  eosGetPublicKey: typeof eosGetPublicKey;
107
109
  eosSignTransaction: typeof eosSignTransaction;
@@ -0,0 +1,2 @@
1
+ export declare function requestWebUSBDevice(): void;
2
+ //# sourceMappingURL=requestWebUSBDevice.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=requestWebUSBDevice.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.0.5",
3
+ "version": "9.0.6",
4
4
  "author": "Trezor <info@trezor.io>",
5
5
  "homepage": "https://github.com/trezor/trezor-suite/tree/develop/packages/connect",
6
6
  "description": "High-level javascript interface for Trezor hardware wallet.",
@@ -49,18 +49,19 @@
49
49
  "prepublish": "yarn tsx ../../scripts/prepublish.js"
50
50
  },
51
51
  "dependencies": {
52
- "@trezor/blockchain-link": "^2.1.6",
52
+ "@trezor/blockchain-link": "^2.1.7",
53
53
  "@trezor/connect-common": "0.0.11",
54
- "@trezor/transport": "^1.1.6",
55
- "@trezor/utils": "^9.0.4",
56
- "@trezor/utxo-lib": "^1.0.2",
54
+ "@trezor/transport": "^1.1.7",
55
+ "@trezor/utils": "^9.0.5",
56
+ "@trezor/utxo-lib": "^1.0.3",
57
57
  "bignumber.js": "^9.1.0",
58
58
  "blakejs": "^1.2.1",
59
59
  "bowser": "^2.11.0",
60
60
  "cross-fetch": "^3.1.5",
61
61
  "events": "^3.3.0",
62
62
  "parse-uri": "1.0.7",
63
- "randombytes": "2.1.0"
63
+ "randombytes": "2.1.0",
64
+ "tslib": "2.5.0"
64
65
  },
65
66
  "devDependencies": {
66
67
  "@trezor/connect-analytics": "1.0.0",