@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.
- package/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/lib/api/binance/api/binanceGetAddress.d.ts +1 -1
- package/lib/api/binance/api/binanceGetAddress.js +4 -1
- package/lib/api/binance/api/binanceSignTransaction.d.ts +1 -0
- package/lib/api/binance/api/binanceSignTransaction.js +3 -1
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/binance/binanceSignTx.js +2 -1
- package/lib/api/cardano/api/cardanoGetAddress.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetAddress.js +4 -1
- package/lib/api/cardano/api/cardanoSignTransaction.d.ts +1 -0
- package/lib/api/cardano/api/cardanoSignTransaction.js +3 -0
- package/lib/api/common/paramsValidator.js +5 -3
- package/lib/api/eos/api/eosGetPublicKey.js +2 -0
- package/lib/api/eos/api/eosSignTransaction.d.ts +1 -0
- package/lib/api/eos/api/eosSignTransaction.js +3 -1
- package/lib/api/eos/eosSignTx.d.ts +1 -1
- package/lib/api/eos/eosSignTx.js +2 -1
- package/lib/api/ethereum/api/ethereumGetAddress.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumGetAddress.js +4 -1
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +1 -0
- package/lib/api/ethereum/api/ethereumSignTransaction.js +7 -5
- package/lib/api/ethereum/ethereumSignTx.d.ts +4 -4
- package/lib/api/ethereum/ethereumSignTx.js +4 -2
- package/lib/api/getAddress.d.ts +1 -1
- package/lib/api/getAddress.js +4 -1
- package/lib/api/nem/api/nemGetAddress.d.ts +1 -1
- package/lib/api/nem/api/nemGetAddress.js +4 -1
- package/lib/api/nem/api/nemSignTransaction.js +2 -1
- package/lib/api/nem/nemSignTx.d.ts +1 -1
- package/lib/api/nem/nemSignTx.js +2 -1
- package/lib/api/ripple/api/rippleGetAddress.d.ts +1 -1
- package/lib/api/ripple/api/rippleGetAddress.js +4 -1
- package/lib/api/ripple/api/rippleSignTransaction.js +3 -1
- package/lib/api/signTransaction.js +2 -0
- package/lib/api/solana/additionalInfo.d.ts +10 -0
- package/lib/api/solana/additionalInfo.js +33 -0
- package/lib/api/solana/api/solanaGetAddress.d.ts +1 -1
- package/lib/api/solana/api/solanaGetAddress.js +4 -2
- package/lib/api/solana/api/solanaGetPublicKey.js +1 -2
- package/lib/api/solana/api/solanaSignTransaction.js +2 -1
- package/lib/api/stellar/api/stellarGetAddress.d.ts +1 -1
- package/lib/api/stellar/api/stellarGetAddress.js +4 -1
- package/lib/api/tezos/api/tezosGetAddress.d.ts +1 -1
- package/lib/api/tezos/api/tezosGetAddress.js +4 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +2 -0
- package/lib/api/tezos/tezosSignTx.d.ts +1 -1
- package/lib/api/tezos/tezosSignTx.js +2 -1
- package/lib/backend/Blockchain.js +1 -0
- package/lib/core/AbstractMethod.js +3 -0
- package/lib/data/DataManager.d.ts +11 -0
- package/lib/data/config.d.ts +11 -0
- package/lib/data/config.js +9 -2
- package/lib/data/defaultFeeLevels.js +1 -0
- package/lib/data/deviceAuthenticityConfig.js +4 -1
- package/lib/data/firmwareInfo.d.ts +1 -1
- package/lib/data/firmwareInfo.js +4 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +2 -0
- package/lib/device/Device.js +12 -2
- package/lib/device/DeviceCommands.d.ts +2 -2
- package/lib/device/DeviceCommands.js +10 -3
- package/lib/events/ui-request.d.ts +1 -1
- package/lib/types/api/binance/index.d.ts +1 -0
- package/lib/types/api/bitcoin/index.d.ts +2 -0
- package/lib/types/api/cardano/index.d.ts +2 -0
- package/lib/types/api/eos/index.d.ts +1 -0
- package/lib/types/api/ethereum/index.d.ts +1 -0
- package/lib/types/api/nem/index.d.ts +1 -0
- package/lib/types/api/ripple/index.d.ts +1 -0
- package/lib/types/api/solana/index.d.ts +10 -0
- package/lib/types/api/tezos/index.d.ts +1 -0
- package/lib/types/coinInfo.d.ts +3 -3
- package/lib/types/device.d.ts +1 -1
- package/lib/types/params.d.ts +3 -0
- package/lib/utils/debug.d.ts +5 -1
- package/lib/utils/debug.js +7 -6
- package/lib/utils/deviceFeaturesUtils.js +6 -5
- package/package.json +14 -15
|
@@ -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;
|
package/lib/types/coinInfo.d.ts
CHANGED
|
@@ -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;
|
package/lib/types/device.d.ts
CHANGED
|
@@ -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",
|
package/lib/types/params.d.ts
CHANGED
|
@@ -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;
|
package/lib/utils/debug.d.ts
CHANGED
|
@@ -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
|
|
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;
|
package/lib/utils/debug.js
CHANGED
|
@@ -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 ||
|
|
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
|
-
|
|
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
|
|
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
|
|
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.
|
|
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": "^
|
|
53
|
-
"@ethereumjs/tx": "^
|
|
54
|
-
"@fivebinaries/coin-selection": "2.2.
|
|
55
|
-
"@trezor/blockchain-link": "2.1.
|
|
56
|
-
"@trezor/blockchain-link-types": "1.0.
|
|
57
|
-
"@trezor/connect-analytics": "1.0.
|
|
58
|
-
"@trezor/connect-common": "0.0.
|
|
59
|
-
"@trezor/protobuf": "1.0.
|
|
60
|
-
"@trezor/protocol": "1.0.
|
|
61
|
-
"@trezor/transport": "1.1.
|
|
62
|
-
"@trezor/utils": "9.0.
|
|
63
|
-
"@trezor/utxo-lib": "2.0.
|
|
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": "^
|
|
86
|
+
"tsx": "^4.6.2",
|
|
88
87
|
"typescript": "5.3.2",
|
|
89
88
|
"webpack": "^5.89.0",
|
|
90
89
|
"ws": "7.5.9"
|