@trezor/connect 9.6.2-beta.3 → 9.6.3-beta.1

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.
Files changed (139) hide show
  1. package/CHANGELOG.md +15 -6
  2. package/README.md +1 -1
  3. package/lib/api/applySettings.js +16 -1
  4. package/lib/api/bitcoin/signtx.d.ts +2 -2
  5. package/lib/api/bitcoin/signtx.js +1 -1
  6. package/lib/api/bleUnpair.js +0 -1
  7. package/lib/api/cardano/api/cardanoGetAddress.d.ts +1 -0
  8. package/lib/api/cardano/api/cardanoSignMessage.d.ts +25 -0
  9. package/lib/api/cardano/api/cardanoSignMessage.js +97 -0
  10. package/lib/api/cardano/api/index.d.ts +1 -0
  11. package/lib/api/cardano/api/index.js +3 -1
  12. package/lib/api/cardano/cardanoUtils.d.ts +1 -1
  13. package/lib/api/cardano/cardanoUtils.js +2 -2
  14. package/lib/api/discoverAccounts.js +61 -33
  15. package/lib/api/ethereum/api/ethereumGetAddress.js +1 -0
  16. package/lib/api/ethereum/api/ethereumSignTransaction.js +22 -4
  17. package/lib/api/ethereum/ethereumSignTx.d.ts +3 -2
  18. package/lib/api/ethereum/ethereumSignTx.js +4 -2
  19. package/lib/api/evoluGetNode.d.ts +11 -0
  20. package/lib/api/evoluGetNode.js +26 -0
  21. package/lib/api/firmware/calculateFirmwareHash.d.ts +2 -1
  22. package/lib/api/firmware/calculateFirmwareHash.js +17 -4
  23. package/lib/api/firmware/getBinary.d.ts +7 -6
  24. package/lib/api/firmware/getBinary.js +18 -6
  25. package/lib/api/firmware/index.d.ts +0 -2
  26. package/lib/api/firmware/index.js +1 -5
  27. package/lib/api/firmware/uploadFirmware.d.ts +10 -1
  28. package/lib/api/firmware/uploadFirmware.js +8 -7
  29. package/lib/api/getFeatures.d.ts +2 -1
  30. package/lib/api/index.d.ts +3 -0
  31. package/lib/api/index.js +8 -2
  32. package/lib/api/nem/nemSignTx.d.ts +1 -1
  33. package/lib/api/pushTransaction.d.ts +2 -1
  34. package/lib/api/pushTransaction.js +2 -1
  35. package/lib/api/resetDevice.js +2 -1
  36. package/lib/api/ripple/api/rippleGetAddress.d.ts +1 -0
  37. package/lib/api/signMessage.js +1 -1
  38. package/lib/api/signTransaction.d.ts +1 -1
  39. package/lib/api/solana/api/solanaGetAddress.d.ts +1 -0
  40. package/lib/api/solana/api/solanaGetPublicKey.d.ts +2 -0
  41. package/lib/api/solana/api/solanaGetPublicKey.js +3 -0
  42. package/lib/api/stellar/api/stellarGetAddress.d.ts +1 -0
  43. package/lib/api/tezos/api/tezosGetAddress.d.ts +1 -0
  44. package/lib/api/tezos/tezosSignTx.d.ts +1 -1
  45. package/lib/api/thpGetCredentials.d.ts +10 -0
  46. package/lib/api/thpGetCredentials.js +31 -0
  47. package/lib/api/thpRemoveCredentials.d.ts +8 -0
  48. package/lib/api/thpRemoveCredentials.js +32 -0
  49. package/lib/api/wipeDevice.js +6 -2
  50. package/lib/backend/Blockchain.d.ts +4 -4
  51. package/lib/backend/Blockchain.js +12 -11
  52. package/lib/constants/cardano.d.ts +3 -0
  53. package/lib/constants/cardano.js +5 -1
  54. package/lib/constants/errors.d.ts +12 -9
  55. package/lib/constants/errors.js +18 -24
  56. package/lib/core/AbstractMethod.d.ts +5 -24
  57. package/lib/core/AbstractMethod.js +2 -2
  58. package/lib/core/index.js +5 -1
  59. package/lib/core/onCallFirmwareUpdate.d.ts +13 -1
  60. package/lib/core/onCallFirmwareUpdate.js +158 -94
  61. package/lib/data/DataManager.d.ts +13 -1
  62. package/lib/data/DataManager.js +44 -14
  63. package/lib/data/coinInfo.d.ts +8 -84
  64. package/lib/data/coinInfo.js +6 -9
  65. package/lib/data/config.d.ts +26 -192
  66. package/lib/data/config.js +37 -1
  67. package/lib/data/connectSettings.js +7 -0
  68. package/lib/data/defaultFeeLevels.js +2 -1
  69. package/lib/data/deviceAuthenticityConfig.js +10 -1
  70. package/lib/data/firmwareInfo.d.ts +44 -11
  71. package/lib/data/firmwareInfo.js +360 -122
  72. package/lib/data/thpSettings.js +5 -2
  73. package/lib/data/version.d.ts +2 -1
  74. package/lib/data/version.js +4 -3
  75. package/lib/device/Device.d.ts +17 -7
  76. package/lib/device/Device.js +72 -115
  77. package/lib/device/DeviceCommands.d.ts +1 -0
  78. package/lib/device/DeviceCurrentSession.d.ts +41 -20
  79. package/lib/device/DeviceCurrentSession.js +18 -22
  80. package/lib/device/TransportList.js +10 -5
  81. package/lib/device/checkFirmwareRevision.d.ts +3 -2
  82. package/lib/device/checkFirmwareRevision.js +6 -11
  83. package/lib/device/thp/handshake.d.ts +4 -0
  84. package/lib/device/thp/handshake.js +88 -0
  85. package/lib/device/thp/index.d.ts +4 -1
  86. package/lib/device/thp/index.js +24 -6
  87. package/lib/device/thp/pairing.d.ts +16 -0
  88. package/lib/device/thp/pairing.js +230 -0
  89. package/lib/device/thp/session.d.ts +3 -0
  90. package/lib/device/thp/session.js +27 -0
  91. package/lib/device/thp/thpCall.d.ts +41 -0
  92. package/lib/device/thp/thpCall.js +57 -0
  93. package/lib/device/workflow/checkFirmwareHash.d.ts +10 -0
  94. package/lib/device/workflow/checkFirmwareHash.js +79 -0
  95. package/lib/device/workflow/checkFirmwareHashWithRetries.d.ts +9 -0
  96. package/lib/device/workflow/checkFirmwareHashWithRetries.js +41 -0
  97. package/lib/device/workflow/handshake.js +7 -6
  98. package/lib/device/workflow/validateState.js +53 -10
  99. package/lib/events/ui-request.d.ts +1 -1
  100. package/lib/factory.js +4 -0
  101. package/lib/tsconfig.lib.tsbuildinfo +1 -1
  102. package/lib/types/api/bitcoin/index.d.ts +1 -1
  103. package/lib/types/api/cardano/index.d.ts +62 -1
  104. package/lib/types/api/cardano/index.js +30 -1
  105. package/lib/types/api/cardanoSignMessage.d.ts +4 -0
  106. package/lib/types/api/cardanoSignMessage.js +3 -0
  107. package/lib/types/api/discoverAccounts.d.ts +17 -12
  108. package/lib/types/api/ethereum/index.d.ts +108 -0
  109. package/lib/types/api/ethereum/index.js +3 -0
  110. package/lib/types/api/evoluGetNode.d.ts +4 -0
  111. package/lib/types/api/evoluGetNode.js +3 -0
  112. package/lib/types/api/index.d.ts +8 -0
  113. package/lib/types/api/pushTransaction.d.ts +4 -1
  114. package/lib/types/api/pushTransaction.js +7 -1
  115. package/lib/types/api/solana/index.d.ts +3 -0
  116. package/lib/types/api/solana/index.js +2 -0
  117. package/lib/types/api/thpGetCredentials.d.ts +4 -0
  118. package/lib/types/api/thpGetCredentials.js +3 -0
  119. package/lib/types/api/thpRemoveCredentials.d.ts +7 -0
  120. package/lib/types/api/thpRemoveCredentials.js +3 -0
  121. package/lib/types/device.d.ts +9 -9
  122. package/lib/types/firmware.d.ts +15 -12
  123. package/lib/types/firmware.js +0 -3
  124. package/lib/types/params.d.ts +1 -0
  125. package/lib/types/settings.d.ts +7 -0
  126. package/lib/utils/assetUtils.d.ts +5 -2
  127. package/lib/utils/assetUtils.js +14 -18
  128. package/lib/utils/assets.native.js +0 -2
  129. package/lib/utils/firmwareReleaseConfigUtils.d.ts +8 -5
  130. package/lib/utils/firmwareReleaseConfigUtils.js +74 -59
  131. package/lib/utils/firmwareUtils.d.ts +8 -4
  132. package/lib/utils/firmwareUtils.js +62 -20
  133. package/lib/utils/formatUtils.d.ts +1 -0
  134. package/lib/utils/formatUtils.js +3 -2
  135. package/package.json +19 -18
  136. package/lib/api/firmware/getBinaryForFirmwareUpgrade.d.ts +0 -12
  137. package/lib/api/firmware/getBinaryForFirmwareUpgrade.js +0 -32
  138. package/lib/data/getLanguage.d.ts +0 -6
  139. package/lib/data/getLanguage.js +0 -10
@@ -4,41 +4,53 @@ exports.DataManager = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const coins_eth_json_1 = tslib_1.__importDefault(require("@trezor/connect-common/files/coins-eth.json"));
6
6
  const coins_json_1 = tslib_1.__importDefault(require("@trezor/connect-common/files/coins.json"));
7
- const device_utils_1 = require("@trezor/device-utils");
8
7
  const messages_json_1 = tslib_1.__importDefault(require("@trezor/protobuf/messages.json"));
9
8
  const coinInfo_1 = require("./coinInfo");
10
9
  const firmwareInfo_1 = require("./firmwareInfo");
11
- const assetUtils_1 = require("../utils/assetUtils");
10
+ const firmwareReleaseConfigUtils_1 = require("../utils/firmwareReleaseConfigUtils");
12
11
  class DataManager {
13
12
  static assets = {};
14
13
  static settings;
15
14
  static messages = messages_json_1.default;
16
15
  static localFirmwares = { firmwareDir: '', firmwareList: [] };
17
- static load(settings, withAssets = true) {
16
+ static firmwareReleasesConfig = {};
17
+ static firmwareIntermediaryReleasesConfig;
18
+ static localFirmwareReleaseConfig;
19
+ static async load(settings, withAssets = true, onlyLocalFirmwareConfig = false) {
18
20
  this.settings = settings;
19
21
  if (!withAssets)
20
22
  return;
21
23
  const assetsMap = {
22
24
  coins: coins_json_1.default,
23
25
  coinsEth: coins_eth_json_1.default,
24
- ...Object.fromEntries(Object.entries(assetUtils_1.firmwareAssets).map(([key, value]) => {
25
- const release = Array.isArray(value) ? value : [];
26
- return [`firmware-${key.toLowerCase()}`, release];
27
- })),
28
26
  };
29
27
  Object.assign(this.assets, assetsMap);
30
28
  (0, coinInfo_1.parseCoinsJson)({
31
29
  ...this.assets.coins,
32
30
  ...this.assets.coinsEth,
33
31
  });
34
- for (const model in device_utils_1.DeviceModelInternal) {
35
- const firmwareKey = `firmware-${model.toLowerCase()}`;
36
- const modelType = device_utils_1.DeviceModelInternal[model];
37
- const modelReleases = this.assets[firmwareKey];
38
- if (modelReleases) {
39
- (0, firmwareInfo_1.parseFirmwareReleases)(modelReleases, modelType);
40
- }
32
+ this.prepareLocalFirmwareReleaseData();
33
+ await this.loadFirmwareRelaseConfig(onlyLocalFirmwareConfig);
34
+ }
35
+ static prepareLocalFirmwareReleaseData() {
36
+ const { config } = (0, firmwareReleaseConfigUtils_1.getOnlyLocalFirmwareReleaseConfig)();
37
+ this.setLocalFirmwareReleaseConfig(config);
38
+ }
39
+ static async loadFirmwareRelaseConfig(onlyLocal) {
40
+ let firmwareRelaseConfig;
41
+ if (onlyLocal) {
42
+ firmwareRelaseConfig = {
43
+ config: this.getLocalFirmwareReleaseConfig(),
44
+ isRemote: false,
45
+ };
46
+ }
47
+ else {
48
+ firmwareRelaseConfig = await (0, firmwareReleaseConfigUtils_1.getFirmwareReleaseConfig)();
41
49
  }
50
+ const { config, isRemote } = firmwareRelaseConfig;
51
+ const firmwareconfig = await (0, firmwareInfo_1.initializeFirmwareConfig)(config, isRemote);
52
+ this.setFirmwareReleaseConfig(firmwareconfig.releases);
53
+ this.setFirmwareIntermediaryReleaseConfig(firmwareconfig.intermediaries);
42
54
  }
43
55
  static getProtobufMessages() {
44
56
  return this.messages;
@@ -57,6 +69,24 @@ class DataManager {
57
69
  static getLocalFirmwares() {
58
70
  return this.localFirmwares;
59
71
  }
72
+ static setLocalFirmwareReleaseConfig(localFirmwareReleaseConfig) {
73
+ this.localFirmwareReleaseConfig = localFirmwareReleaseConfig;
74
+ }
75
+ static getLocalFirmwareReleaseConfig() {
76
+ return this.localFirmwareReleaseConfig;
77
+ }
78
+ static setFirmwareReleaseConfig(releaseConfig) {
79
+ this.firmwareReleasesConfig = releaseConfig;
80
+ }
81
+ static getFirmwareReleaseConfig() {
82
+ return this.firmwareReleasesConfig;
83
+ }
84
+ static setFirmwareIntermediaryReleaseConfig(intermediariesConfig) {
85
+ this.firmwareIntermediaryReleasesConfig = intermediariesConfig;
86
+ }
87
+ static getFirmwareIntermediaryReleaseConfig() {
88
+ return this.firmwareIntermediaryReleasesConfig;
89
+ }
60
90
  }
61
91
  exports.DataManager = DataManager;
62
92
  //# sourceMappingURL=DataManager.js.map
@@ -1,5 +1,5 @@
1
1
  import type { BitcoinNetworkInfo, DerivationPath } from '../types';
2
- export declare const getBitcoinNetwork: (pathOrName: DerivationPath) => ({
2
+ export declare const getBitcoinNetwork: (pathOrName: DerivationPath) => Readonly<{
3
3
  blockchainLink?: {
4
4
  type: string;
5
5
  url: string[];
@@ -62,8 +62,8 @@ export declare const getBitcoinNetwork: (pathOrName: DerivationPath) => ({
62
62
  wif: number;
63
63
  };
64
64
  isBitcoin: boolean;
65
- }) | undefined;
66
- export declare const getEthereumNetwork: (pathOrNetworkSymbol: DerivationPath) => ({
65
+ }>;
66
+ export declare const getEthereumNetwork: (pathOrNetworkSymbol: DerivationPath) => Readonly<{
67
67
  blockchainLink?: {
68
68
  type: string;
69
69
  url: string[];
@@ -101,8 +101,8 @@ export declare const getEthereumNetwork: (pathOrNetworkSymbol: DerivationPath) =
101
101
  network?: undefined;
102
102
  type: "ethereum";
103
103
  chainId: number;
104
- }) | undefined;
105
- export declare const getMiscNetwork: (pathOrName: DerivationPath) => ({
104
+ }>;
105
+ export declare const getMiscNetwork: (pathOrName: DerivationPath) => Readonly<{
106
106
  blockchainLink?: {
107
107
  type: string;
108
108
  url: string[];
@@ -140,7 +140,7 @@ export declare const getMiscNetwork: (pathOrName: DerivationPath) => ({
140
140
  network?: undefined;
141
141
  type: "nem" | "misc";
142
142
  curve: string;
143
- }) | undefined;
143
+ }>;
144
144
  export declare const getSegwitNetwork: (coin: BitcoinNetworkInfo) => {
145
145
  bip32: {
146
146
  public: number;
@@ -229,7 +229,7 @@ export declare const fixCoinInfoNetwork: (ci: BitcoinNetworkInfo, path: number[]
229
229
  };
230
230
  isBitcoin: boolean;
231
231
  };
232
- export declare const getCoinInfo: (currency: string) => ({
232
+ export declare const getCoinInfo: (currency: string) => Readonly<{
233
233
  blockchainLink?: {
234
234
  type: string;
235
235
  url: string[];
@@ -292,83 +292,7 @@ export declare const getCoinInfo: (currency: string) => ({
292
292
  wif: number;
293
293
  };
294
294
  isBitcoin: boolean;
295
- }) | ({
296
- blockchainLink?: {
297
- type: string;
298
- url: string[];
299
- } | undefined;
300
- label: string;
301
- blockTime: number;
302
- minFee: number;
303
- maxFee: number;
304
- minPriorityFee: number;
305
- name: string;
306
- shortcut: string;
307
- slip44: number;
308
- support: {
309
- T1B1: string | false;
310
- T2T1: string | false;
311
- T2B1: string | false;
312
- T3B1: string | false;
313
- T3T1: string | false;
314
- T3W1: string | false;
315
- UNKNOWN: string | false;
316
- connect: boolean;
317
- };
318
- decimals: number;
319
- defaultFees: {
320
- feePerTx?: string | undefined;
321
- feeLimit?: string | undefined;
322
- baseFeePerGas?: string | undefined;
323
- maxFeePerGas?: string | undefined;
324
- maxPriorityFeePerGas?: string | undefined;
325
- label: "normal" | "custom" | "high" | "economy" | "low";
326
- blocks: number;
327
- feePerUnit: string;
328
- }[];
329
- } & {
330
- network?: undefined;
331
- type: "ethereum";
332
- chainId: number;
333
- }) | ({
334
- blockchainLink?: {
335
- type: string;
336
- url: string[];
337
- } | undefined;
338
- label: string;
339
- blockTime: number;
340
- minFee: number;
341
- maxFee: number;
342
- minPriorityFee: number;
343
- name: string;
344
- shortcut: string;
345
- slip44: number;
346
- support: {
347
- T1B1: string | false;
348
- T2T1: string | false;
349
- T2B1: string | false;
350
- T3B1: string | false;
351
- T3T1: string | false;
352
- T3W1: string | false;
353
- UNKNOWN: string | false;
354
- connect: boolean;
355
- };
356
- decimals: number;
357
- defaultFees: {
358
- feePerTx?: string | undefined;
359
- feeLimit?: string | undefined;
360
- baseFeePerGas?: string | undefined;
361
- maxFeePerGas?: string | undefined;
362
- maxPriorityFeePerGas?: string | undefined;
363
- label: "normal" | "custom" | "high" | "economy" | "low";
364
- blocks: number;
365
- feePerUnit: string;
366
- }[];
367
- } & {
368
- network?: undefined;
369
- type: "nem" | "misc";
370
- curve: string;
371
- }) | undefined;
295
+ }>;
372
296
  export declare const getCoinName: (path: number[]) => string;
373
297
  export declare const ethereumNetworkInfoBase: {
374
298
  type: "ethereum";
@@ -8,35 +8,32 @@ const bitcoinNetworks = [];
8
8
  const ethereumNetworks = [];
9
9
  const miscNetworks = [];
10
10
  const getBitcoinNetwork = (pathOrName) => {
11
- const networks = (0, utils_1.cloneObject)(bitcoinNetworks);
12
11
  if (typeof pathOrName === 'string') {
13
12
  const name = pathOrName.toLowerCase();
14
- return networks.find(n => n.name.toLowerCase() === name ||
13
+ return bitcoinNetworks.find(n => n.name.toLowerCase() === name ||
15
14
  n.shortcut.toLowerCase() === name ||
16
15
  n.label.toLowerCase() === name);
17
16
  }
18
17
  const slip44 = (0, pathUtils_1.fromHardened)(pathOrName[1]);
19
- return networks.find(n => n.slip44 === slip44);
18
+ return bitcoinNetworks.find(n => n.slip44 === slip44);
20
19
  };
21
20
  exports.getBitcoinNetwork = getBitcoinNetwork;
22
21
  const getEthereumNetwork = (pathOrNetworkSymbol) => {
23
- const networks = (0, utils_1.cloneObject)(ethereumNetworks);
24
22
  if (typeof pathOrNetworkSymbol === 'string') {
25
23
  const networkSymbol = pathOrNetworkSymbol.toLowerCase();
26
- return networks.find(network => network.shortcut.toLowerCase() === networkSymbol);
24
+ return ethereumNetworks.find(network => network.shortcut.toLowerCase() === networkSymbol);
27
25
  }
28
26
  const slip44 = (0, pathUtils_1.fromHardened)(pathOrNetworkSymbol[1]);
29
- return networks.find(n => n.slip44 === slip44);
27
+ return ethereumNetworks.find(n => n.slip44 === slip44);
30
28
  };
31
29
  exports.getEthereumNetwork = getEthereumNetwork;
32
30
  const getMiscNetwork = (pathOrName) => {
33
- const networks = (0, utils_1.cloneObject)(miscNetworks);
34
31
  if (typeof pathOrName === 'string') {
35
32
  const name = pathOrName.toLowerCase();
36
- return networks.find(n => n.name.toLowerCase() === name || n.shortcut.toLowerCase() === name);
33
+ return miscNetworks.find(n => n.name.toLowerCase() === name || n.shortcut.toLowerCase() === name);
37
34
  }
38
35
  const slip44 = (0, pathUtils_1.fromHardened)(pathOrName[1]);
39
- return networks.find(n => n.slip44 === slip44);
36
+ return miscNetworks.find(n => n.slip44 === slip44);
40
37
  };
41
38
  exports.getMiscNetwork = getMiscNetwork;
42
39
  const getSegwitNetwork = (coin) => {
@@ -1,199 +1,33 @@
1
- export declare const config: {
2
- webusb: {
3
- vendorId: number;
4
- productId: number;
5
- }[];
6
- whitelist: {
1
+ import { DeviceModelInternal } from '@trezor/device-utils';
2
+ import { TREZOR_USB_DESCRIPTORS } from '@trezor/transport/lib/constants';
3
+ type Config = {
4
+ webusb: typeof TREZOR_USB_DESCRIPTORS;
5
+ whitelist: Array<{
7
6
  origin: string;
8
7
  priority: number;
9
- }[];
10
- management: {
8
+ }>;
9
+ management: Array<{
11
10
  origin: string;
12
- }[];
13
- knownHosts: {
11
+ }>;
12
+ knownHosts: Array<{
14
13
  origin: string;
15
14
  label: string;
16
- }[];
17
- onionDomains: {
18
- 'trezor.io': string;
19
- };
20
- supportedBrowsers: {
21
- chrome: {
22
- version: number;
23
- download: string;
24
- update: string;
25
- };
26
- mobilechrome: {
27
- version: number;
28
- download: string;
29
- update: string;
30
- };
31
- chromium: {
32
- version: number;
33
- download: string;
34
- update: string;
35
- };
36
- electron: {
37
- version: number;
38
- download: string;
39
- update: string;
40
- };
41
- firefox: {
42
- version: number;
43
- download: string;
44
- update: string;
45
- };
46
- mobilefirefox: {
47
- version: number;
48
- download: string;
49
- update: string;
50
- };
51
- brave: {
52
- version: number;
53
- download: string;
54
- update: string;
55
- };
56
- edge: {
57
- version: number;
58
- download: string;
59
- update: string;
60
- };
61
- opera: {
62
- version: number;
63
- download: string;
64
- update: string;
65
- };
66
- };
67
- supportedFirmware: ({
68
- coin: string[];
69
- methods: string[];
70
- min: {
71
- T1B1: string;
72
- T2T1: string;
73
- T3T1?: undefined;
74
- T2B1?: undefined;
75
- T3B1?: undefined;
76
- };
77
- max: undefined;
78
- comment: string[];
79
- capabilities?: undefined;
80
- } | {
81
- coin: string[];
82
- min: {
83
- T1B1: string;
84
- T2T1: string;
85
- T3T1?: undefined;
86
- T2B1?: undefined;
87
- T3B1?: undefined;
88
- };
89
- comment: string[];
90
- methods?: undefined;
91
- max?: undefined;
92
- capabilities?: undefined;
93
- } | {
94
- methods: string[];
95
- min: {
96
- T1B1: string;
97
- T2T1: string;
98
- T3T1?: undefined;
99
- T2B1?: undefined;
100
- T3B1?: undefined;
101
- };
102
- comment: string[];
103
- coin?: undefined;
104
- max?: undefined;
105
- capabilities?: undefined;
106
- } | {
107
- capabilities: string[];
108
- min: {
109
- T1B1: string;
110
- T2T1: string;
111
- T3T1?: undefined;
112
- T2B1?: undefined;
113
- T3B1?: undefined;
114
- };
115
- comment: string[];
116
- coin?: undefined;
117
- methods?: undefined;
118
- max?: undefined;
119
- } | {
120
- coin: string[];
121
- methods: string[];
122
- min: {
123
- T1B1: string;
124
- T2T1: string;
125
- T3T1?: undefined;
126
- T2B1?: undefined;
127
- T3B1?: undefined;
128
- };
129
- comment: string[];
130
- max?: undefined;
131
- capabilities?: undefined;
132
- } | {
133
- capabilities: string[];
134
- methods: string[];
135
- min: {
136
- T1B1: string;
137
- T2T1: string;
138
- T3T1?: undefined;
139
- T2B1?: undefined;
140
- T3B1?: undefined;
141
- };
142
- coin?: undefined;
143
- max?: undefined;
144
- comment?: undefined;
145
- } | {
146
- methods: string[];
147
- min: {
148
- T1B1: string;
149
- T2T1: string;
150
- T3T1: string;
151
- T2B1?: undefined;
152
- T3B1?: undefined;
153
- };
154
- coin?: undefined;
155
- max?: undefined;
156
- comment?: undefined;
157
- capabilities?: undefined;
158
- } | {
159
- methods: string[];
160
- min: {
161
- T1B1: string;
162
- T2T1: string;
163
- T2B1: string;
164
- T3T1?: undefined;
165
- T3B1?: undefined;
166
- };
167
- coin?: undefined;
168
- max?: undefined;
169
- comment?: undefined;
170
- capabilities?: undefined;
171
- } | {
172
- capabilities: string[];
173
- min: {
174
- T1B1: string;
175
- T2T1: string;
176
- T2B1: string;
177
- T3T1?: undefined;
178
- T3B1?: undefined;
179
- };
180
- comment: string[];
181
- coin?: undefined;
182
- methods?: undefined;
183
- max?: undefined;
184
- } | {
185
- capabilities: string[];
186
- min: {
187
- T1B1: string;
188
- T2T1: string;
189
- T2B1: string;
190
- T3B1: string;
191
- T3T1: string;
192
- };
193
- coin?: undefined;
194
- methods?: undefined;
195
- max?: undefined;
196
- comment?: undefined;
197
- })[];
15
+ }>;
16
+ onionDomains: Record<string, string>;
17
+ supportedBrowsers: Record<string, {
18
+ version: number;
19
+ download: string;
20
+ update: string;
21
+ }>;
22
+ supportedFirmware: Array<{
23
+ coin?: string[];
24
+ capabilities?: string[];
25
+ methods?: string[];
26
+ min: Partial<Record<DeviceModelInternal, string>>;
27
+ max?: undefined;
28
+ comment?: string[];
29
+ }>;
198
30
  };
31
+ export declare const config: Config;
32
+ export {};
199
33
  //# sourceMappingURL=config.d.ts.map
@@ -219,7 +219,16 @@ exports.config = {
219
219
  min: { T1B1: '1.12.1', T2T1: '2.5.3' },
220
220
  },
221
221
  {
222
- methods: ['showDeviceTutorial', 'authenticateDevice'],
222
+ capabilities: ['tutorial'],
223
+ methods: ['showDeviceTutorial'],
224
+ min: {
225
+ T1B1: '0',
226
+ T2T1: '0',
227
+ T3T1: '2.8.0',
228
+ },
229
+ },
230
+ {
231
+ methods: ['authenticateDevice'],
223
232
  min: {
224
233
  T1B1: '0',
225
234
  T2T1: '0',
@@ -262,6 +271,33 @@ exports.config = {
262
271
  capabilities: ['entropyCheck'],
263
272
  min: { T1B1: '1.13.1', T2T1: '2.8.7', T2B1: '2.8.7', T3B1: '2.8.7', T3T1: '2.8.7' },
264
273
  },
274
+ {
275
+ capabilities: ['evmApproval'],
276
+ min: { T1B1: '0', T2T1: '2.9.0', T2B1: '2.9.0', T3B1: '2.9.0', T3T1: '2.9.0' },
277
+ comment: ['EVM approval flow for ERC20 tokens, introduced in firmware 2.9.0'],
278
+ },
279
+ {
280
+ capabilities: ['slip24'],
281
+ methods: ['getNonce'],
282
+ min: { T1B1: '0', T2T1: '2.9.1', T2B1: '2.9.1', T3B1: '2.9.1', T3T1: '2.9.1' },
283
+ comment: ['Since firmware 2.9.1 SLIP-24 is supported'],
284
+ },
285
+ {
286
+ methods: ['cardanoSignMessage'],
287
+ min: { T1B1: '0', T2T1: '2.9.1', T2B1: '2.9.1', T3B1: '2.9.1', T3T1: '2.9.1' },
288
+ comment: ['Cardano SignMessage call added in 2.9.1'],
289
+ },
290
+ {
291
+ capabilities: ['evolu'],
292
+ methods: ['evoluGetNode'],
293
+ min: {
294
+ T1B1: '0',
295
+ T2T1: '2.9.2',
296
+ T2B1: '2.9.2',
297
+ T3B1: '2.9.2',
298
+ T3T1: '2.9.2',
299
+ },
300
+ },
265
301
  ],
266
302
  };
267
303
  //# sourceMappingURL=config.js.map
@@ -100,6 +100,9 @@ const parseConnectSettings = (input = {}) => {
100
100
  if (typeof input.localFirmwares === 'object') {
101
101
  settings.localFirmwares = (0, exports.parseLocalFirmwares)(input.localFirmwares);
102
102
  }
103
+ if (typeof input.firmwareUpdateSource === 'string') {
104
+ settings.firmwareUpdateSource = input.firmwareUpdateSource;
105
+ }
103
106
  if (Array.isArray(input.transports)) {
104
107
  settings.transports = input.transports;
105
108
  }
@@ -143,6 +146,10 @@ const parseConnectSettings = (input = {}) => {
143
146
  if (typeof input.enableFirmwareHashCheck === 'boolean') {
144
147
  settings.enableFirmwareHashCheck = Boolean(input.enableFirmwareHashCheck);
145
148
  }
149
+ if (typeof input.firmwareHashCheckTimeouts === 'object' &&
150
+ input.firmwareHashCheckTimeouts !== null) {
151
+ settings.firmwareHashCheckTimeouts = input.firmwareHashCheckTimeouts;
152
+ }
146
153
  if (typeof input.npmVersion === 'string') {
147
154
  settings.npmVersion = input.npmVersion;
148
155
  }
@@ -43,11 +43,12 @@ const getBitcoinFeeLevels = (coin) => {
43
43
  blocks: getDefaultBlocksForFeeLevel(shortcut, label),
44
44
  };
45
45
  });
46
+ const minFee = coin.shortcut === 'BTC' ? coin.minfee_kb / 1000 : Math.round(coin.minfee_kb / 1000);
46
47
  return {
47
48
  blockTime: Math.max(1, Math.round(coin.blocktime_seconds / 60)),
48
49
  dustLimit: coin.dust_limit,
49
50
  maxFee: Math.round(coin.maxfee_kb / 1000),
50
- minFee: Math.round(coin.minfee_kb / 1000),
51
+ minFee,
51
52
  minPriorityFee: -1,
52
53
  defaultFees: levels,
53
54
  };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deviceAuthenticityConfig = void 0;
4
4
  exports.deviceAuthenticityConfig = {
5
5
  version: 1,
6
- timestamp: '2025-05-25T12:00:00.000Z',
6
+ timestamp: '2025-09-04T12:00:00.000Z',
7
7
  T2B1: {
8
8
  rootPubKeys: [
9
9
  '04ca97480ac0d7b1e6efafe518cd433cec2bf8ab9822d76eafd34363b55d63e60380bff20acc75cde03cffcb50ab6f8ce70c878e37ebc58ff7cca0a83b16b15fa5',
@@ -90,6 +90,15 @@ exports.deviceAuthenticityConfig = {
90
90
  '0406f9e393b85787a8cc64592da993088a8e2c67b80046e6c9b567b0317e4829d7c6b6c8776ed2bbdd7e5d0ce4a72728ef12b62a022bff9179476a2e73a5df77e9',
91
91
  '0450fd843fc53a32bfb3db32ddbd8ba9010e3f2f68fc411b2f1f0807312e39469f463aad467afc1d43147e7832972c7b0308b247da9f284d259d96ee78fb6f5cb8',
92
92
  '04e38848f936b8cd47500ff5343afbbbe41e47b83037a14bb84a7cf5f7d5e3e14a38374ce4af968bc842aa7a9f69e8bed74a0a0aab72e7e05184c1522beca6689e',
93
+ '0420fe4e6903c8f4fb1ffa8640a39092f388eb3ac239023fca588f5021f141274c2b3825965c4430e0e343eef7a3d9d2ee3a8d136187e90d31ebc3a3bea2d3fe1e',
94
+ '043196c95801dba297dd155ada7077a262a9bf05e760008df08b50a73e8916f68ff4e2a82f66b42460eed8957041b94d99d52d727cfd56a4831d392b8d777ca236',
95
+ '044e884f99e77fc2cbaf2dbc549f9333e512cf57d87eb4e608928c25f2e487ab0a2949912c760a92ae074220ce434e0fda321a16589cca79eeca22268be97aad06',
96
+ '044873940e329eb82d2029d72844ddc42b8472333d6d3b8b6722d3bdb83ae61439a15ba7a4f74fb42f51d99045acc7fda96b19b230c47f8460b5275529d3ee4ab7',
97
+ '0484185b05748b4ab1f2d26cf9e8f7e3fa60c7027caaeb6a9fea1d6235329d43fa6c56f86b17ec2292aeb46f3cacdc64f30e5d429c6b0bd06d7f7951454e82504d',
98
+ '04ac63e1bf03df4a9d0a2fcbf3cf0f4e5f1f91fd1b12c2593ce99644765462e456298f4887d00276ac08a2e78495e6977c8b23041ca74d47ed4ee73acfd17b2664',
99
+ '0427674a879f7add64219f3d13dc28dd8c718566f3a387d42a3d3ab1065aa099b603d13a35c97a5f6ef5fa3b0363031ea58ccb12e5e05a7293d540c7178be259e7',
100
+ '04972aaac10ff9e2a6b9ffd32189e5a7a4aea27b390fbbcaaa42d612765c801f43578227052189d47b359f5c8b5ecf9540cf55d3ad65ff859ba7eb63288aa7161e',
101
+ '04a3e29c1b92b16e1c52033eca0382cf4a5a1f71e16e89893f59844a230f4ed0946338224955ac80127df7f27133239152bcd539340b3e416656ce9027cf2b657e',
93
102
  ],
94
103
  debug: {
95
104
  rootPubKeys: [
@@ -1,14 +1,47 @@
1
- import { DeviceModelInternal, FirmwareRelease, VersionArray } from '@trezor/device-utils';
2
- import type { Features, ReleaseInfo } from '../types';
3
- export declare const parseFirmwareReleases: (modelReleases: FirmwareRelease[], deviceModel: DeviceModelInternal) => void;
4
- export declare const getReleases: (deviceModel: DeviceModelInternal) => FirmwareRelease[];
5
- export declare const getOnlineReleases: (internalModel: DeviceModelInternal) => Promise<FirmwareRelease[]>;
6
- export interface GetInfoProps {
1
+ import { ConditionalRelease, DeviceModelInternal, FirmwareRelease, FirmwareReleaseConfig, IntermediaryReleaseConfig, VersionArray } from '@trezor/device-utils';
2
+ import { Features, FirmwareReleaseConfigInfo, FirmwareType } from '../types';
3
+ export type FirmwareUpdateSource = 'production' | 'test-unsigned' | 'test-signed' | 'localhost-unsigned' | 'localhost-signed';
4
+ export declare const getOnlineFirmwareBaseUrl: () => {
5
+ env: FirmwareUpdateSource;
6
+ BASE_URL: string;
7
+ MIDDLE_PATH: string;
8
+ };
9
+ export declare const getBundledRelease: (deviceModel: DeviceModelInternal, firmwareType: FirmwareType) => FirmwareRelease | undefined;
10
+ export declare const getOnlineReleaseByVersion: (deviceModel: DeviceModelInternal, firmwareVersion: VersionArray, firmwareType: FirmwareType) => Promise<FirmwareRelease | undefined>;
11
+ export declare const getReleaseConfig: (features: Features, firmwareType: FirmwareType) => ConditionalRelease | undefined;
12
+ export declare const getReleaseByVersion: (features: Features, firmwareVersion: VersionArray, firmwareType: FirmwareType) => Promise<FirmwareRelease | undefined>;
13
+ export declare const createLocalFirmwareConfig: (baseConfig: FirmwareReleaseConfig) => any;
14
+ export declare const createRemoteFirmwareConfig: (config: FirmwareReleaseConfig) => Promise<any>;
15
+ export declare const initializeFirmwareConfig: (config: FirmwareReleaseConfig, isRemote: boolean) => Promise<{
16
+ releases: any;
17
+ intermediaries: Record<DeviceModelInternal, IntermediaryReleaseConfig[]>;
18
+ }>;
19
+ export declare const getLanguage: (languageBinPath: string) => Promise<ArrayBuffer | Buffer<ArrayBufferLike>>;
20
+ export type CurrentVersion = {
21
+ bootloaderVersion: VersionArray | null;
22
+ firmwareVersion: VersionArray | null;
23
+ };
24
+ interface GetReleaseInfoParams {
7
25
  features: Features;
8
- releases: FirmwareRelease[];
26
+ release: FirmwareRelease;
27
+ conditions: ConditionalRelease['conditions'];
28
+ intermediary: IntermediaryReleaseConfig | undefined;
29
+ firmwareType: FirmwareType;
30
+ isBitcoinOnlyAvailable: boolean;
9
31
  }
10
- export declare const getInfo: ({ features, releases }: GetInfoProps) => ReleaseInfo | null;
11
- export declare const getFirmwareStatus: (features: Features) => "valid" | "outdated" | "required" | "unknown" | "custom" | "none";
12
- export declare const getReleaseInfo: (features: Features) => ReleaseInfo | null;
13
- export declare const getRelease: (internalModel: DeviceModelInternal, firmwareVersion: VersionArray | undefined) => FirmwareRelease | undefined;
32
+ export declare const getReleaseInfo: ({ features, release, conditions, intermediary, firmwareType, isBitcoinOnlyAvailable, }: GetReleaseInfoParams) => FirmwareReleaseConfigInfo;
33
+ export declare const getFirmwareReleaseConfigInfo: (features: Features, firmwareType: FirmwareType) => FirmwareReleaseConfigInfo | undefined;
34
+ export declare const getFirmwareStatus: (features: Features, firmwareType: FirmwareType) => "valid" | "outdated" | "required" | "unknown" | "custom" | "none";
35
+ type GetFirmwareLocationParam = {
36
+ firmwareVersion: VersionArray;
37
+ remotePath: string;
38
+ deviceModel: DeviceModelInternal;
39
+ firmwareType: FirmwareType;
40
+ intermediaryVersion?: number;
41
+ };
42
+ export declare const getFirmwareLocation: ({ firmwareVersion, remotePath, deviceModel, firmwareType, intermediaryVersion, }: GetFirmwareLocationParam) => {
43
+ baseUrl: string;
44
+ path: string;
45
+ };
46
+ export {};
14
47
  //# sourceMappingURL=firmwareInfo.d.ts.map