@trezor/connect 9.1.6 → 9.1.7

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 (80) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/lib/api/binance/api/binanceGetAddress.d.ts +1 -1
  4. package/lib/api/binance/api/binanceGetAddress.js +4 -1
  5. package/lib/api/binance/api/binanceSignTransaction.d.ts +1 -0
  6. package/lib/api/binance/api/binanceSignTransaction.js +3 -1
  7. package/lib/api/binance/binanceSignTx.d.ts +1 -1
  8. package/lib/api/binance/binanceSignTx.js +2 -1
  9. package/lib/api/cardano/api/cardanoGetAddress.d.ts +1 -1
  10. package/lib/api/cardano/api/cardanoGetAddress.js +4 -1
  11. package/lib/api/cardano/api/cardanoSignTransaction.d.ts +1 -0
  12. package/lib/api/cardano/api/cardanoSignTransaction.js +3 -0
  13. package/lib/api/common/paramsValidator.js +5 -3
  14. package/lib/api/eos/api/eosGetPublicKey.js +2 -0
  15. package/lib/api/eos/api/eosSignTransaction.d.ts +1 -0
  16. package/lib/api/eos/api/eosSignTransaction.js +3 -1
  17. package/lib/api/eos/eosSignTx.d.ts +1 -1
  18. package/lib/api/eos/eosSignTx.js +2 -1
  19. package/lib/api/ethereum/api/ethereumGetAddress.d.ts +1 -1
  20. package/lib/api/ethereum/api/ethereumGetAddress.js +4 -1
  21. package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +1 -0
  22. package/lib/api/ethereum/api/ethereumSignTransaction.js +7 -5
  23. package/lib/api/ethereum/ethereumSignTx.d.ts +4 -4
  24. package/lib/api/ethereum/ethereumSignTx.js +4 -2
  25. package/lib/api/getAddress.d.ts +1 -1
  26. package/lib/api/getAddress.js +4 -1
  27. package/lib/api/nem/api/nemGetAddress.d.ts +1 -1
  28. package/lib/api/nem/api/nemGetAddress.js +4 -1
  29. package/lib/api/nem/api/nemSignTransaction.js +2 -1
  30. package/lib/api/nem/nemSignTx.d.ts +1 -1
  31. package/lib/api/nem/nemSignTx.js +2 -1
  32. package/lib/api/ripple/api/rippleGetAddress.d.ts +1 -1
  33. package/lib/api/ripple/api/rippleGetAddress.js +4 -1
  34. package/lib/api/ripple/api/rippleSignTransaction.js +3 -1
  35. package/lib/api/signTransaction.js +2 -0
  36. package/lib/api/solana/additionalInfo.d.ts +10 -0
  37. package/lib/api/solana/additionalInfo.js +33 -0
  38. package/lib/api/solana/api/solanaGetAddress.d.ts +1 -1
  39. package/lib/api/solana/api/solanaGetAddress.js +4 -2
  40. package/lib/api/solana/api/solanaGetPublicKey.js +1 -2
  41. package/lib/api/solana/api/solanaSignTransaction.js +2 -1
  42. package/lib/api/stellar/api/stellarGetAddress.d.ts +1 -1
  43. package/lib/api/stellar/api/stellarGetAddress.js +4 -1
  44. package/lib/api/tezos/api/tezosGetAddress.d.ts +1 -1
  45. package/lib/api/tezos/api/tezosGetAddress.js +4 -1
  46. package/lib/api/tezos/api/tezosGetPublicKey.js +2 -0
  47. package/lib/api/tezos/tezosSignTx.d.ts +1 -1
  48. package/lib/api/tezos/tezosSignTx.js +2 -1
  49. package/lib/backend/Blockchain.js +1 -0
  50. package/lib/core/AbstractMethod.js +3 -0
  51. package/lib/data/DataManager.d.ts +11 -0
  52. package/lib/data/config.d.ts +11 -0
  53. package/lib/data/config.js +9 -2
  54. package/lib/data/defaultFeeLevels.js +1 -0
  55. package/lib/data/deviceAuthenticityConfig.js +4 -1
  56. package/lib/data/firmwareInfo.d.ts +1 -1
  57. package/lib/data/firmwareInfo.js +4 -1
  58. package/lib/data/version.d.ts +1 -1
  59. package/lib/data/version.js +1 -1
  60. package/lib/device/Device.d.ts +2 -0
  61. package/lib/device/Device.js +12 -2
  62. package/lib/device/DeviceCommands.d.ts +2 -2
  63. package/lib/device/DeviceCommands.js +10 -3
  64. package/lib/events/ui-request.d.ts +1 -1
  65. package/lib/types/api/binance/index.d.ts +1 -0
  66. package/lib/types/api/bitcoin/index.d.ts +2 -0
  67. package/lib/types/api/cardano/index.d.ts +2 -0
  68. package/lib/types/api/eos/index.d.ts +1 -0
  69. package/lib/types/api/ethereum/index.d.ts +1 -0
  70. package/lib/types/api/nem/index.d.ts +1 -0
  71. package/lib/types/api/ripple/index.d.ts +1 -0
  72. package/lib/types/api/solana/index.d.ts +10 -0
  73. package/lib/types/api/tezos/index.d.ts +1 -0
  74. package/lib/types/coinInfo.d.ts +3 -3
  75. package/lib/types/device.d.ts +1 -1
  76. package/lib/types/params.d.ts +3 -0
  77. package/lib/utils/debug.d.ts +5 -1
  78. package/lib/utils/debug.js +7 -6
  79. package/lib/utils/deviceFeaturesUtils.js +6 -5
  80. package/package.json +14 -15
@@ -87,5 +87,6 @@ export type NEMTransaction = NEMRegularTransaction | NEMMultisigTransaction;
87
87
  export interface NEMSignTransaction {
88
88
  path: DerivationPath;
89
89
  transaction: NEMTransaction;
90
+ chunkify?: boolean;
90
91
  }
91
92
  //# sourceMappingURL=index.d.ts.map
@@ -14,6 +14,7 @@ export interface RippleTransaction {
14
14
  export interface RippleSignTransaction {
15
15
  path: DerivationPath;
16
16
  transaction: RippleTransaction;
17
+ chunkify?: boolean;
17
18
  }
18
19
  export interface RippleSignedTx {
19
20
  serializedTx: string;
@@ -2,9 +2,19 @@ import type { PublicKey } from '../../params';
2
2
  export interface SolanaPublicKey extends PublicKey {
3
3
  publicKey: string;
4
4
  }
5
+ export interface SolanaTxTokenAccountInfo {
6
+ baseAddress: string;
7
+ tokenProgram: string;
8
+ tokenMint: string;
9
+ tokenAccount: string;
10
+ }
11
+ export interface SolanaTxAdditionalInfo {
12
+ tokenAccountsInfos?: SolanaTxTokenAccountInfo[];
13
+ }
5
14
  export interface SolanaSignTransaction {
6
15
  path: string | number[];
7
16
  serializedTx: string;
17
+ additionalInfo?: SolanaTxAdditionalInfo;
8
18
  }
9
19
  export interface SolanaSignedTransaction {
10
20
  signature: string;
@@ -55,5 +55,6 @@ export interface TezosSignTransaction {
55
55
  path: DerivationPath;
56
56
  branch: string;
57
57
  operation: TezosOperation;
58
+ chunkify?: boolean;
58
59
  }
59
60
  //# sourceMappingURL=index.d.ts.map
@@ -3,9 +3,9 @@ import { FeeLevel } from './fees';
3
3
  export type { Network } from '@trezor/utxo-lib';
4
4
  export interface CoinSupport {
5
5
  connect: boolean;
6
- T1B1: string;
7
- T2T1: string;
8
- T2B1: string;
6
+ T1B1: string | false;
7
+ T2T1: string | false;
8
+ T2B1: string | false;
9
9
  }
10
10
  export interface BlockchainLink {
11
11
  type: string;
@@ -2,7 +2,7 @@ import type { PROTO } from '../constants';
2
2
  import type { ReleaseInfo } from './firmware';
3
3
  export type DeviceStatus = 'available' | 'occupied' | 'used';
4
4
  export type DeviceMode = 'normal' | 'bootloader' | 'initialize' | 'seedless';
5
- export type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none';
5
+ export type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'custom' | 'none';
6
6
  export type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated';
7
7
  export declare enum FirmwareType {
8
8
  BitcoinOnly = "bitcoin-only",
@@ -11,6 +11,7 @@ export interface CommonParams {
11
11
  override?: boolean;
12
12
  skipFinalReload?: boolean;
13
13
  useCardanoDerivation?: boolean;
14
+ chunkify?: boolean;
14
15
  }
15
16
  export type Params<T> = CommonParams & T & {
16
17
  bundle?: undefined;
@@ -49,6 +50,7 @@ export interface GetAddress {
49
50
  path: DerivationPath;
50
51
  address?: string;
51
52
  showOnTrezor?: boolean;
53
+ chunkify?: boolean;
52
54
  }
53
55
  export interface Address {
54
56
  address: string;
@@ -59,6 +61,7 @@ export interface GetPublicKey {
59
61
  path: DerivationPath;
60
62
  showOnTrezor?: boolean;
61
63
  suppressBackupWarning?: boolean;
64
+ chunkify?: boolean;
62
65
  }
63
66
  export interface PublicKey {
64
67
  publicKey: string;
@@ -14,7 +14,11 @@ export declare class Log {
14
14
  messages: LogMessage[];
15
15
  logWriter: LogWriter | undefined;
16
16
  constructor(prefix: string, enabled: boolean, logWriter?: LogWriter);
17
- addMessage(level: string, prefix: string, ...args: any[]): void;
17
+ addMessage({ level, prefix, timestamp }: {
18
+ level: string;
19
+ prefix: string;
20
+ timestamp?: number;
21
+ }, ...args: any[]): void;
18
22
  setWriter(logWriter: any): void;
19
23
  log(...args: any[]): void;
20
24
  error(...args: any[]): void;
@@ -8,6 +8,7 @@ const yellow = '#fbd948';
8
8
  const colors = {
9
9
  '@trezor/connect': `color: ${blue}; background: #000;`,
10
10
  '@trezor/connect-web': `color: ${blue}; background: #000;`,
11
+ '@trezor/connect-webextension': `color: ${blue}; background: #000;`,
11
12
  IFrame: `color: ${orange}; background: #000;`,
12
13
  Core: `color: ${orange}; background: #000;`,
13
14
  DeviceList: `color: ${green}; background: #000;`,
@@ -28,13 +29,13 @@ class Log {
28
29
  this.logWriter = logWriter;
29
30
  }
30
31
  }
31
- addMessage(level, prefix, ...args) {
32
+ addMessage({ level, prefix, timestamp }, ...args) {
32
33
  const message = {
33
34
  level,
34
35
  prefix,
35
36
  css: this.css,
36
37
  message: args,
37
- timestamp: Date.now(),
38
+ timestamp: timestamp || Date.now(),
38
39
  };
39
40
  this.messages.push(message);
40
41
  if (this.logWriter) {
@@ -53,25 +54,25 @@ class Log {
53
54
  this.logWriter = logWriter;
54
55
  }
55
56
  log(...args) {
56
- this.addMessage('log', this.prefix, ...args);
57
+ this.addMessage({ level: 'log', prefix: this.prefix }, ...args);
57
58
  if (this.enabled) {
58
59
  console.log(`%c${this.prefix}`, this.css, ...args);
59
60
  }
60
61
  }
61
62
  error(...args) {
62
- this.addMessage('error', this.prefix, ...args);
63
+ this.addMessage({ level: 'error', prefix: this.prefix }, ...args);
63
64
  if (this.enabled) {
64
65
  console.error(`%c${this.prefix}`, this.css, ...args);
65
66
  }
66
67
  }
67
68
  warn(...args) {
68
- this.addMessage('warn', this.prefix, ...args);
69
+ this.addMessage({ level: 'warn', prefix: this.prefix }, ...args);
69
70
  if (this.enabled) {
70
71
  console.warn(`%c${this.prefix}`, this.css, ...args);
71
72
  }
72
73
  }
73
74
  debug(...args) {
74
- this.addMessage('debug', this.prefix, ...args);
75
+ this.addMessage({ level: 'debug', prefix: this.prefix }, ...args);
75
76
  if (this.enabled) {
76
77
  if (this.css) {
77
78
  console.log(`%c${this.prefix}`, this.css, ...args);
@@ -42,10 +42,10 @@ const getUnavailableCapabilities = (features, coins) => {
42
42
  const list = {};
43
43
  if (!capabilities)
44
44
  return list;
45
- const fw = [features.major_version, features.minor_version, features.patch_version];
45
+ const fw = [features.major_version, features.minor_version, features.patch_version].join('.');
46
46
  const key = features.internal_model;
47
47
  const supported = coins.filter(info => {
48
- if (!info.support || typeof info.support[key] !== 'string') {
48
+ if (!info.support || info.support[key] === false) {
49
49
  list[info.shortcut.toLowerCase()] = 'no-support';
50
50
  return false;
51
51
  }
@@ -80,7 +80,8 @@ const getUnavailableCapabilities = (features, coins) => {
80
80
  supported
81
81
  .filter(info => !unavailable.includes(info))
82
82
  .forEach(info => {
83
- if (utils_1.versionUtils.isNewer(info.support[key], fw.join('.'))) {
83
+ const supportVersion = info.support[key];
84
+ if (typeof supportVersion === 'string' && utils_1.versionUtils.isNewer(supportVersion, fw)) {
84
85
  list[info.shortcut.toLowerCase()] = 'update-required';
85
86
  unavailable.push(info);
86
87
  }
@@ -90,13 +91,13 @@ const getUnavailableCapabilities = (features, coins) => {
90
91
  return;
91
92
  const min = s.min ? s.min[key] : null;
92
93
  const max = s.max ? s.max[key] : null;
93
- if (min && (min === '0' || utils_1.versionUtils.isNewer(min, fw.join('.')))) {
94
+ if (min && (min === '0' || utils_1.versionUtils.isNewer(min, fw))) {
94
95
  const value = min === '0' ? 'no-support' : 'update-required';
95
96
  s.capabilities.forEach(m => {
96
97
  list[m] = value;
97
98
  });
98
99
  }
99
- if (max && !utils_1.versionUtils.isNewerOrEqual(max, fw.join('.'))) {
100
+ if (max && !utils_1.versionUtils.isNewerOrEqual(max, fw)) {
100
101
  s.capabilities.forEach(m => {
101
102
  list[m] = 'trezor-connect-outdated';
102
103
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.1.6",
3
+ "version": "9.1.7",
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,18 @@
49
49
  "prepublish": "yarn tsx ../../scripts/prepublish.js"
50
50
  },
51
51
  "dependencies": {
52
- "@ethereumjs/common": "^3.1.2",
53
- "@ethereumjs/tx": "^4.1.2",
54
- "@fivebinaries/coin-selection": "2.2.0",
55
- "@trezor/blockchain-link": "2.1.19",
56
- "@trezor/blockchain-link-types": "1.0.8",
57
- "@trezor/connect-analytics": "1.0.9",
58
- "@trezor/connect-common": "0.0.23",
59
- "@trezor/protobuf": "1.0.3",
60
- "@trezor/protocol": "1.0.3",
61
- "@trezor/transport": "1.1.18",
62
- "@trezor/utils": "9.0.15",
63
- "@trezor/utxo-lib": "2.0.1",
52
+ "@ethereumjs/common": "^4.1.0",
53
+ "@ethereumjs/tx": "^5.1.0",
54
+ "@fivebinaries/coin-selection": "2.2.1",
55
+ "@trezor/blockchain-link": "2.1.20",
56
+ "@trezor/blockchain-link-types": "1.0.9",
57
+ "@trezor/connect-analytics": "1.0.10",
58
+ "@trezor/connect-common": "0.0.24",
59
+ "@trezor/protobuf": "1.0.4",
60
+ "@trezor/protocol": "1.0.4",
61
+ "@trezor/transport": "1.1.19",
62
+ "@trezor/utils": "9.0.16",
63
+ "@trezor/utxo-lib": "2.0.2",
64
64
  "bignumber.js": "^9.1.1",
65
65
  "blakejs": "^1.2.1",
66
66
  "bs58": "^5.0.0",
@@ -74,7 +74,6 @@
74
74
  "@types/parse-uri": "^1.0.2",
75
75
  "ethereum-cryptography": "^2.0.0",
76
76
  "jest": "29.5.0",
77
- "jest-environment-jsdom": "^29.5.0",
78
77
  "karma": "^6.4.2",
79
78
  "karma-babel-preprocessor": "^8.0.2",
80
79
  "karma-chrome-launcher": "^3.2.0",
@@ -84,7 +83,7 @@
84
83
  "karma-webpack": "^5.0.0",
85
84
  "rimraf": "^5.0.5",
86
85
  "ts-node": "^10.9.1",
87
- "tsx": "^3.14.0",
86
+ "tsx": "^4.6.2",
88
87
  "typescript": "5.3.2",
89
88
  "webpack": "^5.89.0",
90
89
  "ws": "7.5.9"