@trezor/connect 9.6.2-beta.2 → 9.6.2

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,17 +1,17 @@
1
- | Package | Stable | Canary |
2
- | :------------------------------: | :----: | :----------: |
3
- | npm @trezor/connect | 9.6.1 | 9.6.2-beta.2 |
4
- | npm @trezor/connect-web | 9.6.1 | 9.6.2-beta.2 |
5
- | npm @trezor/connect-webextension | 9.6.1 | 9.6.2-beta.2 |
6
- | npm @trezor/connect-mobile | 9.6.1 | 9.6.2-beta.2 |
1
+ | Package | Stable | Canary |
2
+ | :------------------------------: | :----: | :----: |
3
+ | npm @trezor/connect | 9.6.2 | - |
4
+ | npm @trezor/connect-web | 9.6.2 | - |
5
+ | npm @trezor/connect-webextension | 9.6.2 | - |
6
+ | npm @trezor/connect-mobile | 9.6.2 | - |
7
7
 
8
- | Deployment | Stable | Canary |
9
- | :----------------: | :----: | :----------: |
10
- | connect.trezor.io/ | 9.6.1 | 9.6.2-beta.2 |
8
+ | Deployment | Stable | Canary |
9
+ | :----------------: | :----: | :----: |
10
+ | connect.trezor.io/ | 9.6.2 | - |
11
11
 
12
12
  Use the persistent link [connect.trezor.io/9](https://connect.trezor.io/9/) to access the latest stable version of Connect Explorer.
13
13
 
14
- # 9.6.2-beta.2
14
+ # 9.6.2
15
15
 
16
16
  This release is important for smooth support of 2.9.0 trezor firmware, namely commits:
17
17
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @trezor/connect
2
2
 
3
- API version 9.6.2-beta.2
3
+ API version 9.6.2
4
4
 
5
5
  [![Build Status](https://github.com/trezor/trezor-suite/actions/workflows/test-connect.yml/badge.svg)](https://github.com/trezor/trezor-suite/actions/workflows/test-connect.yml)
6
6
  [![NPM](https://img.shields.io/npm/v/@trezor/connect.svg)](https://www.npmjs.org/package/@trezor/connect)
@@ -99,7 +99,7 @@ export default class EthereumSignTypedData extends AbstractMethod<'ethereumSignT
99
99
  init(): void;
100
100
  initAsync(): Promise<void>;
101
101
  get info(): string;
102
- getButtonRequestData(code: string): {
102
+ getButtonRequestData(code: string, name?: string): {
103
103
  type: "message";
104
104
  coin: string;
105
105
  serializedPath: string;
@@ -74,8 +74,18 @@ class EthereumSignTypedData extends AbstractMethod_1.AbstractMethod {
74
74
  get info() {
75
75
  return (0, ethereumUtils_1.getNetworkLabel)('Sign #NETWORK typed data', (0, coinInfo_1.getEthereumNetwork)(this.params.address_n));
76
76
  }
77
- getButtonRequestData(code) {
78
- if (code === 'ButtonRequest_Other' || code === 'ButtonRequest_SignTx') {
77
+ getButtonRequestData(code, name) {
78
+ if ((code === 'ButtonRequest_Other' &&
79
+ name &&
80
+ [
81
+ 'should_show_domain',
82
+ 'should_show_struct',
83
+ 'should_show_array',
84
+ 'confirm_typed_value',
85
+ 'confirm_empty_typed_message',
86
+ 'confirm_typed_data_final',
87
+ ].includes(name)) ||
88
+ code === 'ButtonRequest_SignTx') {
79
89
  return {
80
90
  type: 'message',
81
91
  coin: this.params.network?.shortcut ?? 'ETH',
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.uploadFirmware = void 0;
4
+ const transport_1 = require("@trezor/transport");
4
5
  const constants_1 = require("../../constants");
5
6
  const events_1 = require("../../events");
6
7
  const postConfirmationMessage = (device) => {
@@ -41,16 +42,29 @@ const uploadFirmware = async (typedCall, postMessage, device, { payload }) => {
41
42
  if (device.features.major_version === 2) {
42
43
  postConfirmationMessage(device);
43
44
  const length = payload.byteLength;
45
+ let progress = 0;
44
46
  let response = await typedCall('FirmwareErase', ['FirmwareRequest', 'Success'], { length });
45
47
  while (response.type !== 'Success') {
46
48
  const start = response.message.offset;
47
49
  const end = response.message.offset + response.message.length;
48
50
  const chunk = payload.slice(start, end);
51
+ const progressStart = Math.round((start / length) * 100);
52
+ const progressEnd = Math.round((end / length) * 100);
53
+ const progressDiff = progressEnd - progressStart;
54
+ device.transport.on(transport_1.TRANSPORT.SEND_MESSAGE_PROGRESS, p => {
55
+ const newProgress = progressStart + Math.floor(progressDiff * p);
56
+ if (start > 0 && newProgress > progress) {
57
+ progress = newProgress;
58
+ postProgressMessage(device, progress, postMessage);
59
+ }
60
+ });
49
61
  if (start > 0) {
50
- postProgressMessage(device, Math.round((start / length) * 100), postMessage);
62
+ postProgressMessage(device, progressStart, postMessage);
51
63
  }
52
64
  response = await typedCall('FirmwareUpload', ['FirmwareRequest', 'Success'], {
53
65
  payload: chunk,
66
+ }).finally(() => {
67
+ device.transport.removeAllListeners(transport_1.TRANSPORT.SEND_MESSAGE_PROGRESS);
54
68
  });
55
69
  }
56
70
  postProgressMessage(device, 100, postMessage);
@@ -92,9 +92,7 @@ const getInstallationParams = (device, params) => {
92
92
  const isUpdatingToEqualFirmwareType = (device.firmwareType === 'bitcoin-only') === btcOnly;
93
93
  const upgrade = device.atLeast('2.6.3') && isUpdatingToNewerVersion && isUpdatingToEqualFirmwareType;
94
94
  const manual = !device.atLeast(['1.10.0', '2.6.0']) && !upgrade;
95
- const language = device.atLeast('2.7.0') &&
96
- device.features.internal_model !== constants_1.PROTO.DeviceModelInternal.T2T1 &&
97
- device.features.internal_model !== constants_1.PROTO.DeviceModelInternal.T3T1;
95
+ const language = false;
98
96
  return {
99
97
  manual,
100
98
  upgrade,
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "9.6.2-beta.2";
1
+ export declare const VERSION = "9.6.2";
2
2
  export declare const DEFAULT_DOMAIN: string;
3
3
  export declare const CONTENT_SCRIPT_VERSION = 1;
4
4
  export declare const DEEPLINK_VERSION = 1;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEEPLINK_VERSION = exports.CONTENT_SCRIPT_VERSION = exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
4
- exports.VERSION = '9.6.2-beta.2';
4
+ exports.VERSION = '9.6.2';
5
5
  const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
6
6
  const isBeta = exports.VERSION.includes('beta');
7
7
  exports.DEFAULT_DOMAIN = isBeta
@@ -572,7 +572,7 @@ class Device extends utils_1.TypedEmitter {
572
572
  this._firmwareType = types_1.FirmwareType.BitcoinOnly;
573
573
  }
574
574
  else if (feat.fw_vendor === 'Trezor') {
575
- this._firmwareType = types_1.FirmwareType.Regular;
575
+ this._firmwareType = types_1.FirmwareType.Universal;
576
576
  }
577
577
  else if (this.getMode() !== 'bootloader') {
578
578
  this._firmwareType =
@@ -580,7 +580,7 @@ class Device extends utils_1.TypedEmitter {
580
580
  feat.capabilities.length > 0 &&
581
581
  !feat.capabilities.includes('Capability_Bitcoin_like')
582
582
  ? types_1.FirmwareType.BitcoinOnly
583
- : types_1.FirmwareType.Regular;
583
+ : types_1.FirmwareType.Universal;
584
584
  }
585
585
  const deviceInfo = device_utils_1.models[feat.internal_model] ?? {
586
586
  name: `Unknown ${feat.internal_model}`,
@@ -25,6 +25,7 @@ const allowedCallsBeforeInitialize = [
25
25
  'GetFirmwareHash',
26
26
  'ChangeLanguage',
27
27
  'DataChunkAck',
28
+ 'RebootToBootloader',
28
29
  'FirmwareErase',
29
30
  'FirmwareUpload',
30
31
  ];
@@ -1,5 +1,6 @@
1
1
  import { FeaturesNarrowing, FirmwareType } from '@trezor/device-utils';
2
2
  import type { ThpStateSerialized } from '@trezor/protocol';
3
+ import { Branded } from '@trezor/type-utils';
3
4
  import type { PROTO } from '../constants';
4
5
  import type { ReleaseInfo } from './firmware';
5
6
  export type DeviceStatus = 'available' | 'occupied' | 'used';
@@ -34,9 +35,7 @@ export type FirmwareHashCheckResult = {
34
35
  attemptCount?: number;
35
36
  errorPayload?: unknown;
36
37
  };
37
- export type DeviceUniquePath = string & {
38
- __type: 'DeviceUniquePath';
39
- };
38
+ export type DeviceUniquePath = string & Branded<'DeviceUniquePath'>;
40
39
  export declare const DeviceUniquePath: (id: string) => DeviceUniquePath;
41
40
  type BaseDevice = {
42
41
  path: DeviceUniquePath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.6.2-beta.2",
3
+ "version": "9.6.2",
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.",
@@ -79,21 +79,21 @@
79
79
  "@solana-program/token": "^0.5.1",
80
80
  "@solana-program/token-2022": "^0.4.2",
81
81
  "@solana/kit": "^2.1.1",
82
- "@trezor/blockchain-link": "2.5.2-beta.1",
83
- "@trezor/blockchain-link-types": "1.4.2-beta.2",
84
- "@trezor/blockchain-link-utils": "1.4.2-beta.1",
85
- "@trezor/connect-analytics": "1.3.4",
86
- "@trezor/connect-common": "0.4.2-beta.2",
87
- "@trezor/crypto-utils": "1.1.4-beta.1",
88
- "@trezor/device-utils": "1.1.2-beta.1",
89
- "@trezor/env-utils": "^1.4.2-beta.1",
90
- "@trezor/protobuf": "1.4.2-beta.1",
91
- "@trezor/protocol": "1.2.8-beta.1",
92
- "@trezor/schema-utils": "1.3.4-beta.1",
93
- "@trezor/transport": "1.5.2-beta.1",
94
- "@trezor/type-utils": "1.1.8-beta.1",
95
- "@trezor/utils": "9.4.2-beta.2",
96
- "@trezor/utxo-lib": "2.4.2-beta.1",
82
+ "@trezor/blockchain-link": "2.5.2",
83
+ "@trezor/blockchain-link-types": "1.4.2",
84
+ "@trezor/blockchain-link-utils": "1.4.2",
85
+ "@trezor/connect-analytics": "1.3.5",
86
+ "@trezor/connect-common": "0.4.2",
87
+ "@trezor/crypto-utils": "1.1.4",
88
+ "@trezor/device-utils": "1.1.2",
89
+ "@trezor/env-utils": "^1.4.2",
90
+ "@trezor/protobuf": "1.4.2",
91
+ "@trezor/protocol": "1.2.8",
92
+ "@trezor/schema-utils": "1.3.4",
93
+ "@trezor/transport": "1.5.2",
94
+ "@trezor/type-utils": "1.1.8",
95
+ "@trezor/utils": "9.4.2",
96
+ "@trezor/utxo-lib": "2.4.2",
97
97
  "blakejs": "^1.2.1",
98
98
  "bs58": "^6.0.0",
99
99
  "bs58check": "^4.0.0",