@trezor/connect 9.7.2 → 9.7.3

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,16 +1,20 @@
1
1
  | Package | Stable | Canary |
2
2
  | :------------------------------: | :----: | :----: |
3
- | npm @trezor/connect | 9.7.2 | - |
4
- | npm @trezor/connect-web | 9.7.2 | - |
5
- | npm @trezor/connect-webextension | 9.7.2 | - |
6
- | npm @trezor/connect-mobile | 9.7.2 | - |
3
+ | npm @trezor/connect | 9.7.3 | - |
4
+ | npm @trezor/connect-web | 9.7.3 | - |
5
+ | npm @trezor/connect-webextension | 9.7.3 | - |
6
+ | npm @trezor/connect-mobile | 9.7.3 | - |
7
7
 
8
8
  | Deployment | Stable | Canary |
9
9
  | :----------------: | :----: | :----: |
10
- | connect.trezor.io/ | 9.7.2 | - |
10
+ | connect.trezor.io/ | 9.7.3 | - |
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.7.3
15
+
16
+ Updated `protobufjs` dependency to address security advisory [CVE-2026-41242](https://github.com/advisories/GHSA-xq3m-2v4x-88gg). In our codebase we don't utilize `protobufjs` in a way that would be vulnerable to this issue, but we are updating it to ensure our dependencies are secure.
17
+
14
18
  # 9.7.2
15
19
 
16
20
  We have added support for Tron network in Connect APIs - `tronGetAddress`, `tronSignTransaction`. Available for firmware 2.10.1 and later.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @trezor/connect
2
2
 
3
- API version 9.7.2
3
+ API version 9.7.3
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)
@@ -4,9 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  const schema_utils_1 = require("@trezor/schema-utils");
7
+ const constants_1 = require("../../../constants");
7
8
  const AbstractMethod_1 = require("../../../core/AbstractMethod");
8
9
  const tron_1 = require("../../../types/api/tron");
9
10
  const pathUtils_1 = require("../../../utils/pathUtils");
11
+ const contractMapping = {
12
+ TransferContract: 'TronTransferContract',
13
+ TriggerSmartContract: 'TronTriggerSmartContract',
14
+ FreezeBalanceV2Contract: 'TronFreezeBalanceV2Contract',
15
+ UnfreezeBalanceV2Contract: 'TronUnfreezeBalanceV2Contract',
16
+ WithdrawExpireUnfreezeContract: 'TronWithdrawUnfreeze',
17
+ VoteWitnessContract: 'TronVoteWitnessContract'
18
+ };
10
19
  class TronSignTransaction extends AbstractMethod_1.AbstractMethod {
11
20
  hasBundle;
12
21
  progress = 0;
@@ -16,6 +25,10 @@ class TronSignTransaction extends AbstractMethod_1.AbstractMethod {
16
25
  const {
17
26
  payload
18
27
  } = this;
28
+ const contractType = payload.contract?.[0]?.type;
29
+ if (!contractType || !(contractType in contractMapping)) {
30
+ throw constants_1.ERRORS.TypedError('Method_InvalidParameter', `Unsupported Tron contract type: ${contractType ?? 'undefined'}`);
31
+ }
19
32
  (0, schema_utils_1.Assert)(tron_1.TronSignTransaction, payload);
20
33
  const path = (0, pathUtils_1.validatePath)(payload.path, 3);
21
34
  this.params = {
@@ -38,13 +51,6 @@ class TronSignTransaction extends AbstractMethod_1.AbstractMethod {
38
51
  async run() {
39
52
  const cmd = this.device.getCommands();
40
53
  await cmd.typedCall('TronSignTx', 'TronContractRequest', this.params.tx);
41
- const contractMapping = {
42
- TransferContract: 'TronTransferContract',
43
- TriggerSmartContract: 'TronTriggerSmartContract',
44
- FreezeBalanceV2Contract: 'TronFreezeBalanceV2Contract',
45
- UnfreezeBalanceV2Contract: 'TronUnfreezeBalanceV2Contract',
46
- WithdrawExpireUnfreezeContract: 'TronWithdrawUnfreeze'
47
- };
48
54
  const {
49
55
  message
50
56
  } = await cmd.typedCall(contractMapping[this.params.contractType], 'TronSignature', this.params.contract);
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "9.7.2";
1
+ export declare const VERSION = "9.7.3";
2
2
  export declare const DEFAULT_DOMAIN_MAJOR_VER: string;
3
3
  export declare const DEFAULT_DOMAIN: string;
4
4
  export declare const CONTENT_SCRIPT_VERSION = 1;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DEEPLINK_VERSION = exports.CONTENT_SCRIPT_VERSION = exports.DEFAULT_DOMAIN = exports.DEFAULT_DOMAIN_MAJOR_VER = exports.VERSION = void 0;
7
- exports.VERSION = '9.7.2';
7
+ exports.VERSION = '9.7.3';
8
8
  const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
9
9
  const isBeta = exports.VERSION.includes('beta');
10
10
  exports.DEFAULT_DOMAIN_MAJOR_VER = `https://connect.trezor.io/${versionN[0]}/`;
@@ -1030,6 +1030,12 @@ export declare class DeviceCurrentSession implements TypedCallProvider {
1030
1030
  } | {
1031
1031
  type: "TronTransferContract";
1032
1032
  message: import("@trezor/protobuf/lib/messages").TronTransferContract;
1033
+ } | {
1034
+ type: "TronVote";
1035
+ message: import("@trezor/protobuf/lib/messages").TronVote;
1036
+ } | {
1037
+ type: "TronVoteWitnessContract";
1038
+ message: import("@trezor/protobuf/lib/messages").TronVoteWitnessContract;
1033
1039
  } | {
1034
1040
  type: "TronTriggerSmartContract";
1035
1041
  message: import("@trezor/protobuf/lib/messages").TronTriggerSmartContract;
@@ -44,6 +44,17 @@ export declare const TronContracts: import("@trezor/schema-utils").TUnion<[impor
44
44
  owner_address: import("@trezor/schema-utils").TString;
45
45
  }>;
46
46
  }>;
47
+ }>, import("@trezor/schema-utils").TObject<{
48
+ type: import("@trezor/schema-utils").TLiteral<"VoteWitnessContract">;
49
+ parameter: import("@trezor/schema-utils").TObject<{
50
+ value: import("@trezor/schema-utils").TObject<{
51
+ owner_address: import("@trezor/schema-utils").TString;
52
+ votes: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
53
+ address: import("@trezor/schema-utils").TString;
54
+ count: import("@trezor/schema-utils").TNumber;
55
+ }>>;
56
+ }>;
57
+ }>;
47
58
  }>]>;
48
59
  export type TronContractsTypes = TronContracts['type'];
49
60
  export type TronContractsParameters = TronContracts['parameter']['value'];
@@ -99,6 +110,17 @@ export declare const TronSignTransaction: import("@trezor/schema-utils").TObject
99
110
  owner_address: import("@trezor/schema-utils").TString;
100
111
  }>;
101
112
  }>;
113
+ }>, import("@trezor/schema-utils").TObject<{
114
+ type: import("@trezor/schema-utils").TLiteral<"VoteWitnessContract">;
115
+ parameter: import("@trezor/schema-utils").TObject<{
116
+ value: import("@trezor/schema-utils").TObject<{
117
+ owner_address: import("@trezor/schema-utils").TString;
118
+ votes: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
119
+ address: import("@trezor/schema-utils").TString;
120
+ count: import("@trezor/schema-utils").TNumber;
121
+ }>>;
122
+ }>;
123
+ }>;
102
124
  }>]>>;
103
125
  }>;
104
126
  export type TronSignedTx = Static<typeof TronSignedTx>;
@@ -37,7 +37,13 @@ const TronWithdrawExpireUnfreezeContract = schema_utils_1.Type.Object({
37
37
  value: constants_1.PROTO.TronWithdrawUnfreeze
38
38
  })
39
39
  });
40
- exports.TronContracts = schema_utils_1.Type.Union([TronTransferContract, TronTriggerSmartContract, TronFreezeBalanceV2Contract, TronUnfreezeBalanceV2Contract, TronWithdrawExpireUnfreezeContract]);
40
+ const TronVoteWitnessContract = schema_utils_1.Type.Object({
41
+ type: schema_utils_1.Type.Literal('VoteWitnessContract'),
42
+ parameter: schema_utils_1.Type.Object({
43
+ value: constants_1.PROTO.TronVoteWitnessContract
44
+ })
45
+ });
46
+ exports.TronContracts = schema_utils_1.Type.Union([TronTransferContract, TronTriggerSmartContract, TronFreezeBalanceV2Contract, TronUnfreezeBalanceV2Contract, TronWithdrawExpireUnfreezeContract, TronVoteWitnessContract]);
41
47
  exports.TronSignTransaction = schema_utils_1.Type.Object({
42
48
  path: params_1.DerivationPath,
43
49
  ref_block_bytes: schema_utils_1.Type.String(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.7.2",
3
+ "version": "9.7.3",
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,7 +79,7 @@
79
79
  "@solana-program/token": "^0.5.1",
80
80
  "@solana-program/token-2022": "^0.4.2",
81
81
  "@solana/kit": "^2.3.0",
82
- "@trezor/blockchain-link": "2.6.1",
82
+ "@trezor/blockchain-link": "2.6.2",
83
83
  "@trezor/blockchain-link-types": "1.5.1",
84
84
  "@trezor/blockchain-link-utils": "1.5.2",
85
85
  "@trezor/connect-analytics": "1.4.0",
@@ -88,10 +88,10 @@
88
88
  "@trezor/device-authenticity": "1.1.2",
89
89
  "@trezor/device-utils": "1.2.0",
90
90
  "@trezor/env-utils": "^1.5.0",
91
- "@trezor/protobuf": "1.5.2",
92
- "@trezor/protocol": "1.3.0",
91
+ "@trezor/protobuf": "1.5.3",
92
+ "@trezor/protocol": "1.3.1",
93
93
  "@trezor/schema-utils": "1.4.0",
94
- "@trezor/transport": "1.6.2",
94
+ "@trezor/transport": "1.6.3",
95
95
  "@trezor/type-utils": "1.2.0",
96
96
  "@trezor/utils": "9.5.0",
97
97
  "@trezor/utxo-lib": "2.5.0",