@trezor/connect 9.3.0 → 9.3.1-beta.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 +121 -8
- package/README.md +1 -1
- package/lib/api/checkFirmwareAuthenticity.d.ts +2 -1
- package/lib/api/checkFirmwareAuthenticity.js +34 -26
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +1 -0
- package/lib/api/ethereum/api/ethereumSignTypedData.js +3 -1
- package/lib/api/ethereum/ethereumDefinitions.js +1 -0
- package/lib/api/firmware/getBinary.d.ts +4 -4
- package/lib/api/firmware/getBinary.js +4 -15
- package/lib/api/firmware/getBinaryForFirmwareUpgrade.d.ts +11 -0
- package/lib/api/firmware/getBinaryForFirmwareUpgrade.js +32 -0
- package/lib/api/firmware/index.d.ts +1 -0
- package/lib/api/firmware/index.js +3 -1
- package/lib/api/firmware/verifyAuthenticityProof.d.ts +1 -1
- package/lib/api/firmware/verifyAuthenticityProof.js +37 -2
- package/lib/api/firmware/x509certificate.d.ts +20 -6
- package/lib/api/firmware/x509certificate.js +82 -13
- package/lib/api/getCoinInfo.d.ts +3 -0
- package/lib/api/getFeatures.d.ts +1 -0
- package/lib/backend/Blockchain.js +10 -1
- package/lib/core/AbstractMethod.js +1 -0
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.js +93 -111
- package/lib/core/onCallFirmwareUpdate.js +25 -14
- package/lib/data/DataManager.d.ts +11 -0
- package/lib/data/DataManager.js +1 -1
- package/lib/data/coinInfo.d.ts +14 -0
- package/lib/data/config.d.ts +11 -0
- package/lib/data/config.js +17 -1
- package/lib/data/connectSettings.js +3 -2
- package/lib/data/deviceAuthenticityConfig.d.ts +1 -28
- package/lib/data/deviceAuthenticityConfig.js +25 -24
- package/lib/data/deviceAuthenticityConfigTypes.d.ts +38 -0
- package/lib/data/deviceAuthenticityConfigTypes.js +28 -0
- package/lib/data/models.d.ts +10 -0
- package/lib/data/models.js +12 -10
- package/lib/data/version.d.ts +2 -1
- package/lib/data/version.js +3 -2
- package/lib/device/Device.d.ts +2 -3
- package/lib/device/Device.js +15 -24
- package/lib/device/DeviceCommands.js +2 -27
- package/lib/device/DeviceList.d.ts +42 -27
- package/lib/device/DeviceList.js +249 -233
- package/lib/events/core.d.ts +2 -2
- package/lib/events/popup.d.ts +1 -0
- package/lib/events/transport.d.ts +5 -0
- package/lib/index.js +20 -20
- package/lib/types/api/authenticateDevice.d.ts +9 -0
- package/lib/types/api/authenticateDevice.js +2 -2
- package/lib/types/api/checkFirmwareAuthenticity.d.ts +4 -1
- package/lib/types/api/init.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +7 -0
- package/lib/types/firmware.d.ts +2 -2
- package/lib/types/settings.d.ts +7 -3
- package/lib/utils/assetUtils.js +1 -0
- package/lib/utils/promiseUtils.d.ts +3 -3
- package/lib/utils/promiseUtils.js +7 -5
- package/package.json +16 -17
- package/lib/core/coreManager.d.ts +0 -16
- package/lib/core/coreManager.js +0 -55
package/lib/data/coinInfo.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const getBitcoinNetwork: (pathOrName: DerivationPath) => ({
|
|
|
15
15
|
T1B1: string | false;
|
|
16
16
|
T2T1: string | false;
|
|
17
17
|
T2B1: string | false;
|
|
18
|
+
T3B1: string | false;
|
|
18
19
|
T3T1: string | false;
|
|
19
20
|
connect: boolean;
|
|
20
21
|
};
|
|
@@ -72,6 +73,7 @@ export declare const getEthereumNetwork: (pathOrName: DerivationPath) => ({
|
|
|
72
73
|
T1B1: string | false;
|
|
73
74
|
T2T1: string | false;
|
|
74
75
|
T2B1: string | false;
|
|
76
|
+
T3B1: string | false;
|
|
75
77
|
T3T1: string | false;
|
|
76
78
|
connect: boolean;
|
|
77
79
|
};
|
|
@@ -104,6 +106,7 @@ export declare const getMiscNetwork: (pathOrName: DerivationPath) => ({
|
|
|
104
106
|
T1B1: string | false;
|
|
105
107
|
T2T1: string | false;
|
|
106
108
|
T2B1: string | false;
|
|
109
|
+
T3B1: string | false;
|
|
107
110
|
T3T1: string | false;
|
|
108
111
|
connect: boolean;
|
|
109
112
|
};
|
|
@@ -160,6 +163,7 @@ export declare const fixCoinInfoNetwork: (ci: BitcoinNetworkInfo, path: number[]
|
|
|
160
163
|
T1B1: string | false;
|
|
161
164
|
T2T1: string | false;
|
|
162
165
|
T2B1: string | false;
|
|
166
|
+
T3B1: string | false;
|
|
163
167
|
T3T1: string | false;
|
|
164
168
|
connect: boolean;
|
|
165
169
|
};
|
|
@@ -217,6 +221,7 @@ export declare const getCoinInfoByHash: (hash: string, networkInfo: any) => {
|
|
|
217
221
|
T1B1: string | false;
|
|
218
222
|
T2T1: string | false;
|
|
219
223
|
T2B1: string | false;
|
|
224
|
+
T3B1: string | false;
|
|
220
225
|
T3T1: string | false;
|
|
221
226
|
connect: boolean;
|
|
222
227
|
};
|
|
@@ -274,6 +279,7 @@ export declare const getCoinInfo: (currency: string) => ({
|
|
|
274
279
|
T1B1: string | false;
|
|
275
280
|
T2T1: string | false;
|
|
276
281
|
T2B1: string | false;
|
|
282
|
+
T3B1: string | false;
|
|
277
283
|
T3T1: string | false;
|
|
278
284
|
connect: boolean;
|
|
279
285
|
};
|
|
@@ -330,6 +336,7 @@ export declare const getCoinInfo: (currency: string) => ({
|
|
|
330
336
|
T1B1: string | false;
|
|
331
337
|
T2T1: string | false;
|
|
332
338
|
T2B1: string | false;
|
|
339
|
+
T3B1: string | false;
|
|
333
340
|
T3T1: string | false;
|
|
334
341
|
connect: boolean;
|
|
335
342
|
};
|
|
@@ -361,6 +368,7 @@ export declare const getCoinInfo: (currency: string) => ({
|
|
|
361
368
|
T1B1: string | false;
|
|
362
369
|
T2T1: string | false;
|
|
363
370
|
T2B1: string | false;
|
|
371
|
+
T3B1: string | false;
|
|
364
372
|
T3T1: string | false;
|
|
365
373
|
connect: boolean;
|
|
366
374
|
};
|
|
@@ -410,6 +418,7 @@ export declare const getUniqueNetworks: (networks: (CoinInfo | undefined)[]) =>
|
|
|
410
418
|
T1B1: string | false;
|
|
411
419
|
T2T1: string | false;
|
|
412
420
|
T2B1: string | false;
|
|
421
|
+
T3B1: string | false;
|
|
413
422
|
T3T1: string | false;
|
|
414
423
|
connect: boolean;
|
|
415
424
|
};
|
|
@@ -466,6 +475,7 @@ export declare const getUniqueNetworks: (networks: (CoinInfo | undefined)[]) =>
|
|
|
466
475
|
T1B1: string | false;
|
|
467
476
|
T2T1: string | false;
|
|
468
477
|
T2B1: string | false;
|
|
478
|
+
T3B1: string | false;
|
|
469
479
|
T3T1: string | false;
|
|
470
480
|
connect: boolean;
|
|
471
481
|
};
|
|
@@ -497,6 +507,7 @@ export declare const getUniqueNetworks: (networks: (CoinInfo | undefined)[]) =>
|
|
|
497
507
|
T1B1: string | false;
|
|
498
508
|
T2T1: string | false;
|
|
499
509
|
T2B1: string | false;
|
|
510
|
+
T3B1: string | false;
|
|
500
511
|
T3T1: string | false;
|
|
501
512
|
connect: boolean;
|
|
502
513
|
};
|
|
@@ -529,6 +540,7 @@ export declare const getAllNetworks: () => (({
|
|
|
529
540
|
T1B1: string | false;
|
|
530
541
|
T2T1: string | false;
|
|
531
542
|
T2B1: string | false;
|
|
543
|
+
T3B1: string | false;
|
|
532
544
|
T3T1: string | false;
|
|
533
545
|
connect: boolean;
|
|
534
546
|
};
|
|
@@ -585,6 +597,7 @@ export declare const getAllNetworks: () => (({
|
|
|
585
597
|
T1B1: string | false;
|
|
586
598
|
T2T1: string | false;
|
|
587
599
|
T2B1: string | false;
|
|
600
|
+
T3B1: string | false;
|
|
588
601
|
T3T1: string | false;
|
|
589
602
|
connect: boolean;
|
|
590
603
|
};
|
|
@@ -616,6 +629,7 @@ export declare const getAllNetworks: () => (({
|
|
|
616
629
|
T1B1: string | false;
|
|
617
630
|
T2T1: string | false;
|
|
618
631
|
T2B1: string | false;
|
|
632
|
+
T3B1: string | false;
|
|
619
633
|
T3T1: string | false;
|
|
620
634
|
connect: boolean;
|
|
621
635
|
};
|
package/lib/data/config.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export declare const config: {
|
|
|
62
62
|
T1B1: string;
|
|
63
63
|
T2T1: string;
|
|
64
64
|
T2B1?: undefined;
|
|
65
|
+
T3B1?: undefined;
|
|
65
66
|
T3T1?: undefined;
|
|
66
67
|
};
|
|
67
68
|
max: undefined;
|
|
@@ -73,6 +74,7 @@ export declare const config: {
|
|
|
73
74
|
T1B1: string;
|
|
74
75
|
T2T1: string;
|
|
75
76
|
T2B1?: undefined;
|
|
77
|
+
T3B1?: undefined;
|
|
76
78
|
T3T1?: undefined;
|
|
77
79
|
};
|
|
78
80
|
comment: string[];
|
|
@@ -85,6 +87,7 @@ export declare const config: {
|
|
|
85
87
|
T1B1: string;
|
|
86
88
|
T2T1: string;
|
|
87
89
|
T2B1?: undefined;
|
|
90
|
+
T3B1?: undefined;
|
|
88
91
|
T3T1?: undefined;
|
|
89
92
|
};
|
|
90
93
|
comment: string[];
|
|
@@ -97,6 +100,7 @@ export declare const config: {
|
|
|
97
100
|
T1B1: string;
|
|
98
101
|
T2T1: string;
|
|
99
102
|
T2B1?: undefined;
|
|
103
|
+
T3B1?: undefined;
|
|
100
104
|
T3T1?: undefined;
|
|
101
105
|
};
|
|
102
106
|
comment: string[];
|
|
@@ -110,6 +114,7 @@ export declare const config: {
|
|
|
110
114
|
T1B1: string;
|
|
111
115
|
T2T1: string;
|
|
112
116
|
T2B1?: undefined;
|
|
117
|
+
T3B1?: undefined;
|
|
113
118
|
T3T1?: undefined;
|
|
114
119
|
};
|
|
115
120
|
comment: string[];
|
|
@@ -122,6 +127,7 @@ export declare const config: {
|
|
|
122
127
|
T1B1: string;
|
|
123
128
|
T2T1: string;
|
|
124
129
|
T2B1?: undefined;
|
|
130
|
+
T3B1?: undefined;
|
|
125
131
|
T3T1?: undefined;
|
|
126
132
|
};
|
|
127
133
|
coin?: undefined;
|
|
@@ -133,6 +139,7 @@ export declare const config: {
|
|
|
133
139
|
T1B1: string;
|
|
134
140
|
T2T1: string;
|
|
135
141
|
T2B1: string;
|
|
142
|
+
T3B1?: undefined;
|
|
136
143
|
T3T1?: undefined;
|
|
137
144
|
};
|
|
138
145
|
comment: string[];
|
|
@@ -145,6 +152,7 @@ export declare const config: {
|
|
|
145
152
|
T1B1: string;
|
|
146
153
|
T2T1: string;
|
|
147
154
|
T2B1?: undefined;
|
|
155
|
+
T3B1?: undefined;
|
|
148
156
|
T3T1?: undefined;
|
|
149
157
|
};
|
|
150
158
|
coin?: undefined;
|
|
@@ -157,6 +165,7 @@ export declare const config: {
|
|
|
157
165
|
T1B1: string;
|
|
158
166
|
T2T1: string;
|
|
159
167
|
T2B1: string;
|
|
168
|
+
T3B1?: undefined;
|
|
160
169
|
T3T1?: undefined;
|
|
161
170
|
};
|
|
162
171
|
coin?: undefined;
|
|
@@ -169,6 +178,7 @@ export declare const config: {
|
|
|
169
178
|
T1B1: string;
|
|
170
179
|
T2T1: string;
|
|
171
180
|
T2B1: string;
|
|
181
|
+
T3B1?: undefined;
|
|
172
182
|
T3T1?: undefined;
|
|
173
183
|
};
|
|
174
184
|
comment: string[];
|
|
@@ -181,6 +191,7 @@ export declare const config: {
|
|
|
181
191
|
T1B1: string;
|
|
182
192
|
T2T1: string;
|
|
183
193
|
T2B1: string;
|
|
194
|
+
T3B1: string;
|
|
184
195
|
T3T1: string;
|
|
185
196
|
};
|
|
186
197
|
coin?: undefined;
|
package/lib/data/config.js
CHANGED
|
@@ -51,6 +51,16 @@ exports.config = {
|
|
|
51
51
|
label: 'Rabby',
|
|
52
52
|
icon: '',
|
|
53
53
|
},
|
|
54
|
+
{
|
|
55
|
+
origin: 'ehnpnhnhcickeknioaiodjmielfaoajd',
|
|
56
|
+
label: 'Ambire DEV',
|
|
57
|
+
icon: '',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
origin: 'ehgjhhccekdedpbkifaojjaefeohnoea',
|
|
61
|
+
label: 'Ambire',
|
|
62
|
+
icon: '',
|
|
63
|
+
},
|
|
54
64
|
{ origin: 'file://', label: ' ', icon: '' },
|
|
55
65
|
],
|
|
56
66
|
onionDomains: {
|
|
@@ -259,7 +269,13 @@ exports.config = {
|
|
|
259
269
|
},
|
|
260
270
|
{
|
|
261
271
|
methods: ['changeLanguage'],
|
|
262
|
-
min: {
|
|
272
|
+
min: {
|
|
273
|
+
T1B1: '0',
|
|
274
|
+
T2T1: '2.7.0',
|
|
275
|
+
T2B1: '2.7.0',
|
|
276
|
+
T3B1: '2.8.1',
|
|
277
|
+
T3T1: '2.7.1',
|
|
278
|
+
},
|
|
263
279
|
},
|
|
264
280
|
],
|
|
265
281
|
};
|
|
@@ -107,8 +107,9 @@ const parseConnectSettings = (input = {}) => {
|
|
|
107
107
|
if (typeof input.sharedLogger === 'boolean') {
|
|
108
108
|
settings.sharedLogger = input.sharedLogger;
|
|
109
109
|
}
|
|
110
|
-
if (typeof input.
|
|
111
|
-
|
|
110
|
+
if (typeof input.coreMode === 'string' &&
|
|
111
|
+
['auto', 'popup', 'iframe'].includes(input.coreMode)) {
|
|
112
|
+
settings.coreMode = input.coreMode;
|
|
112
113
|
}
|
|
113
114
|
if (typeof input._extendWebextensionLifetime === 'boolean') {
|
|
114
115
|
settings._extendWebextensionLifetime = input._extendWebextensionLifetime;
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type DeviceAuthenticityConfig = Static<typeof DeviceAuthenticityConfig>;
|
|
3
|
-
export declare const DeviceAuthenticityConfig: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
4
|
-
T2B1: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
5
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
6
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
7
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
8
|
-
debug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
9
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
10
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
11
|
-
}>>;
|
|
12
|
-
}>]>;
|
|
13
|
-
T3T1: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
14
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
15
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
16
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
17
|
-
debug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
18
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
19
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
20
|
-
}>>;
|
|
21
|
-
}>]>;
|
|
22
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
23
|
-
T1B1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
|
|
24
|
-
T2T1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
|
|
25
|
-
}>]>, import("@sinclair/typebox").TObject<{
|
|
26
|
-
version: import("@sinclair/typebox").TNumber;
|
|
27
|
-
timestamp: import("@sinclair/typebox").TString;
|
|
28
|
-
}>]>;
|
|
1
|
+
import { DeviceAuthenticityConfig } from './deviceAuthenticityConfigTypes';
|
|
29
2
|
export declare const deviceAuthenticityConfig: DeviceAuthenticityConfig;
|
|
30
3
|
//# sourceMappingURL=deviceAuthenticityConfig.d.ts.map
|
|
@@ -1,31 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deviceAuthenticityConfig =
|
|
4
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const CertPubKeys = schema_utils_1.Type.Object({
|
|
7
|
-
rootPubKeys: schema_utils_1.Type.Array(schema_utils_1.Type.String()),
|
|
8
|
-
caPubKeys: schema_utils_1.Type.Array(schema_utils_1.Type.String()),
|
|
9
|
-
});
|
|
10
|
-
const ModelPubKeys = schema_utils_1.Type.Intersect([
|
|
11
|
-
schema_utils_1.Type.Record(schema_utils_1.Type.Exclude(schema_utils_1.Type.KeyOfEnum(constants_1.PROTO.DeviceModelInternal), schema_utils_1.Type.Union([schema_utils_1.Type.Literal('T1B1'), schema_utils_1.Type.Literal('T2T1')])), schema_utils_1.Type.Intersect([
|
|
12
|
-
CertPubKeys,
|
|
13
|
-
schema_utils_1.Type.Object({
|
|
14
|
-
debug: schema_utils_1.Type.Optional(CertPubKeys),
|
|
15
|
-
}),
|
|
16
|
-
])),
|
|
17
|
-
schema_utils_1.Type.Partial(schema_utils_1.Type.Record(schema_utils_1.Type.Exclude(schema_utils_1.Type.KeyOfEnum(constants_1.PROTO.DeviceModelInternal), schema_utils_1.Type.Union([schema_utils_1.Type.Literal('T2B1'), schema_utils_1.Type.Literal('T3T1')])), schema_utils_1.Type.Undefined())),
|
|
18
|
-
]);
|
|
19
|
-
exports.DeviceAuthenticityConfig = schema_utils_1.Type.Intersect([
|
|
20
|
-
ModelPubKeys,
|
|
21
|
-
schema_utils_1.Type.Object({
|
|
22
|
-
version: schema_utils_1.Type.Number(),
|
|
23
|
-
timestamp: schema_utils_1.Type.String(),
|
|
24
|
-
}),
|
|
25
|
-
]);
|
|
3
|
+
exports.deviceAuthenticityConfig = void 0;
|
|
26
4
|
exports.deviceAuthenticityConfig = {
|
|
27
5
|
version: 1,
|
|
28
|
-
timestamp: '2024-
|
|
6
|
+
timestamp: '2024-07-09T12:00:00+00:00',
|
|
29
7
|
T2B1: {
|
|
30
8
|
rootPubKeys: [
|
|
31
9
|
'04ca97480ac0d7b1e6efafe518cd433cec2bf8ab9822d76eafd34363b55d63e60380bff20acc75cde03cffcb50ab6f8ce70c878e37ebc58ff7cca0a83b16b15fa5',
|
|
@@ -55,6 +33,12 @@ exports.deviceAuthenticityConfig = {
|
|
|
55
33
|
'0445f15e55a044b1516a7b2cc13dd4e9ea415336f622b9185e4ffc19e2b51627637491195c85f87ac2582ac4a8d89a33983f0700d042fd7e57d55d346f4fbc832c',
|
|
56
34
|
'042b9cede77aa38f1d824ebd5e13129c8c1c163f3ea74b5251e420831ec17329be741b2af96cc6df0c253e4bffdac23f4bb373e53ae1821587ce0ecae476d2b95c',
|
|
57
35
|
'040cea26562b3763dddd741f4428f37cdc931dbd2db9665888505c2be42868ee2d739aed1d0a54c116b889f5d1ff57dae8dcc1e595cf6d69e71853a8053449ab9f',
|
|
36
|
+
'040e656b714a6d5dd579dbb15948335fbe2d4acbbf2943209cf4dcd662fc0fec577c746fad12a0c5b0eae0c1de2f723c9ac3fa3bdfda93f8f6fd167a14c1805fbe',
|
|
37
|
+
'040c87f12d2006b44e9b86f66eb9d51edb18bc3c1884ea678b41a2e0b908ba882b648a1ffd70e31436a30aeab7fe569b6dbbb4d042973d7d06a6ee764f92a72843',
|
|
38
|
+
'044130f0531edb1db0d399206ed4359d9070f4e8ba38193098ddb3d2af00924847d843ee0961346af65647ae81949cc144b0f32c54be2e3a86effa98dd86ebadd0',
|
|
39
|
+
'046d3161213d66b5464ff6546d48f87a807849da6d58f3e58fbc4b21db89cd837955c37afae9a719a8f0899893398188d986b14971c390bc0a69bee8dfabdaa9ad',
|
|
40
|
+
'043e0d5b87f4db112911e1e83f3e5907c310caab70b5bc05980226ee20900d6c87c7b2d0004bf5bfe7af3a161174fe8b762bbc71886c7af1c4ad89166a8221b465',
|
|
41
|
+
'0435817aec4f46df42a3d3cbbe5def767c7eeee56be38b0e0977aa62c225fedd08b99c9496fb9cccbed3507044b4dd4db8191faa750f217cad9a581224106c2be7',
|
|
58
42
|
],
|
|
59
43
|
debug: {
|
|
60
44
|
rootPubKeys: [
|
|
@@ -73,6 +57,9 @@ exports.deviceAuthenticityConfig = {
|
|
|
73
57
|
'045b785b703810363deeadc0faa5a7388d8385f5e4f9170a3c27d3d2506bf9090d5b09044fbad6b906446d8cdb754b65869e8992b26a344e01ecff75844fe5a3d6',
|
|
74
58
|
'046442ece98b1cd13389b6eda3235e2848becc655db564897b2dc0862580f69b29be59dc30f92820f41a7a493b90623e66e1ee8529dbfd60d50aed97b46c4b8f64',
|
|
75
59
|
'0416960078e1d2b44df717ff5445ec76f4247333375982c5ae59b3bc223371f3cf81e7c182fd1ca36c95977070e2ff46f998bff3f00ab0de266edfdd430aea56b8',
|
|
60
|
+
'041aec4007b431c7b5978c126f7e9015e7601f47e835fe13e2028883a45fc8c5d039641474b8cad1e53c4c169fe7d1905402307850ada15b788353ca7c7000939b',
|
|
61
|
+
'04debf2a916d0c5209220ca6d202aefa174913b345d1cfd21a85ddc160626c70a559ac0ec1172041f679d99e3e1d6a30b84b04ed25ba47f707e9c2450dd4d8d1da',
|
|
62
|
+
'045d6d5119d95f29eba79d230df9c5531e0b7c030ba9e7de0cf48a2eb82c57f0a927977f0e1f23bda144d1e90f63b62dc86c14d46bee7bf676619b3db23dc17935',
|
|
76
63
|
],
|
|
77
64
|
debug: {
|
|
78
65
|
rootPubKeys: [
|
|
@@ -83,5 +70,19 @@ exports.deviceAuthenticityConfig = {
|
|
|
83
70
|
],
|
|
84
71
|
},
|
|
85
72
|
},
|
|
73
|
+
T3B1: {
|
|
74
|
+
rootPubKeys: [
|
|
75
|
+
'045b5c3fdd01f3602092834209b86df0ca86a9faf25cac35c73bf6237d66eb21eafcec3706f1ccd5eb4cc7f2fa1751213eccb1c78389afba89a5788ff31ee46a5d',
|
|
76
|
+
],
|
|
77
|
+
caPubKeys: [
|
|
78
|
+
'04860857f8ceb107cf03cc6ef56523b5e440e2ed51933cc49ac8a498063f06ab891bdafd0a1655aa287b9ded8a898d9532ec9d6550db3bb524e7af3e474b013d87',
|
|
79
|
+
'047962b89421e26daa51e0c368d6bbd7d49dcf972b0a6f148c115aedbba533e1574740dfa51c11992c276872ac2f11b3e0f54499c3347e83410142818ac4579b8e',
|
|
80
|
+
'04bc9f1e23ceed59b3e7b6b760a41f1f37ccc252adb1186e4035ec3f46266656400c7cd4c7153c9dec581b655c9ba1f74878c84128e60a66eed46e251e2eaf065f',
|
|
81
|
+
],
|
|
82
|
+
debug: {
|
|
83
|
+
rootPubKeys: [],
|
|
84
|
+
caPubKeys: [],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
86
87
|
};
|
|
87
88
|
//# sourceMappingURL=deviceAuthenticityConfig.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Static } from '@trezor/schema-utils';
|
|
2
|
+
export type DeviceAuthenticityConfig = Static<typeof DeviceAuthenticityConfig>;
|
|
3
|
+
export declare const DeviceAuthenticityConfig: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
4
|
+
T2B1: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
5
|
+
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
6
|
+
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
7
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
8
|
+
debug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
9
|
+
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
10
|
+
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
11
|
+
}>>;
|
|
12
|
+
}>]>;
|
|
13
|
+
T3B1: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
14
|
+
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
15
|
+
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
16
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
17
|
+
debug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
18
|
+
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
19
|
+
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
20
|
+
}>>;
|
|
21
|
+
}>]>;
|
|
22
|
+
T3T1: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
|
23
|
+
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
24
|
+
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
25
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
26
|
+
debug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
27
|
+
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
28
|
+
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
29
|
+
}>>;
|
|
30
|
+
}>]>;
|
|
31
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
32
|
+
T1B1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
|
|
33
|
+
T2T1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
|
|
34
|
+
}>]>, import("@sinclair/typebox").TObject<{
|
|
35
|
+
version: import("@sinclair/typebox").TNumber;
|
|
36
|
+
timestamp: import("@sinclair/typebox").TString;
|
|
37
|
+
}>]>;
|
|
38
|
+
//# sourceMappingURL=deviceAuthenticityConfigTypes.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceAuthenticityConfig = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const CertPubKeys = schema_utils_1.Type.Object({
|
|
7
|
+
rootPubKeys: schema_utils_1.Type.Array(schema_utils_1.Type.String()),
|
|
8
|
+
caPubKeys: schema_utils_1.Type.Array(schema_utils_1.Type.String()),
|
|
9
|
+
});
|
|
10
|
+
const ModelsWithKeys = schema_utils_1.Type.Exclude(schema_utils_1.Type.KeyOfEnum(constants_1.PROTO.DeviceModelInternal), schema_utils_1.Type.Union([schema_utils_1.Type.Literal('T1B1'), schema_utils_1.Type.Literal('T2T1')]));
|
|
11
|
+
const ModelsWithoutKeys = schema_utils_1.Type.Extract(schema_utils_1.Type.KeyOfEnum(constants_1.PROTO.DeviceModelInternal), schema_utils_1.Type.Union([schema_utils_1.Type.Literal('T1B1'), schema_utils_1.Type.Literal('T2T1')]));
|
|
12
|
+
const ModelPubKeys = schema_utils_1.Type.Intersect([
|
|
13
|
+
schema_utils_1.Type.Record(ModelsWithKeys, schema_utils_1.Type.Intersect([
|
|
14
|
+
CertPubKeys,
|
|
15
|
+
schema_utils_1.Type.Object({
|
|
16
|
+
debug: schema_utils_1.Type.Optional(CertPubKeys),
|
|
17
|
+
}),
|
|
18
|
+
])),
|
|
19
|
+
schema_utils_1.Type.Partial(schema_utils_1.Type.Record(ModelsWithoutKeys, schema_utils_1.Type.Undefined())),
|
|
20
|
+
]);
|
|
21
|
+
exports.DeviceAuthenticityConfig = schema_utils_1.Type.Intersect([
|
|
22
|
+
ModelPubKeys,
|
|
23
|
+
schema_utils_1.Type.Object({
|
|
24
|
+
version: schema_utils_1.Type.Number(),
|
|
25
|
+
timestamp: schema_utils_1.Type.String(),
|
|
26
|
+
}),
|
|
27
|
+
]);
|
|
28
|
+
//# sourceMappingURL=deviceAuthenticityConfigTypes.js.map
|
package/lib/data/models.d.ts
CHANGED
package/lib/data/models.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.models = void 0;
|
|
4
|
+
const t2b1 = {
|
|
5
|
+
name: 'Trezor Safe 3',
|
|
6
|
+
colors: {
|
|
7
|
+
'1': 'Cosmic Black',
|
|
8
|
+
'2': 'Stellar Silver',
|
|
9
|
+
'3': 'Solar Gold',
|
|
10
|
+
'4': 'Galactic Rose',
|
|
11
|
+
'5': 'Bitcoin Orange',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
4
14
|
exports.models = {
|
|
5
15
|
T1B1: {
|
|
6
16
|
name: 'Trezor Model One',
|
|
@@ -10,16 +20,8 @@ exports.models = {
|
|
|
10
20
|
name: 'Trezor Model T',
|
|
11
21
|
colors: {},
|
|
12
22
|
},
|
|
13
|
-
T2B1:
|
|
14
|
-
|
|
15
|
-
colors: {
|
|
16
|
-
'1': 'Cosmic Black',
|
|
17
|
-
'2': 'Stellar Silver',
|
|
18
|
-
'3': 'Solar Gold',
|
|
19
|
-
'4': 'Galactic Rose',
|
|
20
|
-
'5': 'Bitcoin Orange',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
+
T2B1: t2b1,
|
|
24
|
+
T3B1: t2b1,
|
|
23
25
|
T3T1: {
|
|
24
26
|
name: 'Trezor Safe 5',
|
|
25
27
|
colors: {
|
package/lib/data/version.d.ts
CHANGED
package/lib/data/version.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '9.3.
|
|
3
|
+
exports.CONTENT_SCRIPT_VERSION = exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
|
|
4
|
+
exports.VERSION = '9.3.1-beta.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
|
|
8
8
|
? `https://connect.trezor.io/${exports.VERSION}/`
|
|
9
9
|
: `https://connect.trezor.io/${versionN[0]}/`;
|
|
10
|
+
exports.CONTENT_SCRIPT_VERSION = 1;
|
|
10
11
|
//# sourceMappingURL=version.js.map
|
package/lib/device/Device.d.ts
CHANGED
|
@@ -12,10 +12,10 @@ export type RunOptions = {
|
|
|
12
12
|
onlyOneActivity?: boolean;
|
|
13
13
|
cancelPopupRequest?: () => any;
|
|
14
14
|
keepSession?: boolean;
|
|
15
|
-
useEmptyPassphrase?: boolean;
|
|
16
15
|
useCardanoDerivation?: boolean;
|
|
17
16
|
};
|
|
18
17
|
export declare const GET_FEATURES_TIMEOUT = 3000;
|
|
18
|
+
export declare const GET_FEATURES_TIMEOUT_REACT_NATIVE = 20000;
|
|
19
19
|
export interface DeviceEvents {
|
|
20
20
|
[DEVICE.PIN]: (device: Device, b: PROTO.PinMatrixRequestType | undefined, callback: (err: any, pin: string) => void) => void;
|
|
21
21
|
[DEVICE.WORD]: (device: Device, b: PROTO.WordRequestType, callback: (err: any, word: string) => void) => void;
|
|
@@ -71,8 +71,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
71
71
|
setExternalState(state?: string): void;
|
|
72
72
|
getExternalState(): string;
|
|
73
73
|
validateState(preauthorized?: boolean): Promise<string | undefined>;
|
|
74
|
-
|
|
75
|
-
initialize(useEmptyPassphrase: boolean, useCardanoDerivation: boolean): Promise<void>;
|
|
74
|
+
initialize(useCardanoDerivation: boolean): Promise<void>;
|
|
76
75
|
getFeatures(): Promise<void>;
|
|
77
76
|
changeLanguage({ language, binary, }: {
|
|
78
77
|
language?: undefined;
|
package/lib/device/Device.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Device = exports.GET_FEATURES_TIMEOUT = void 0;
|
|
3
|
+
exports.Device = exports.GET_FEATURES_TIMEOUT_REACT_NATIVE = exports.GET_FEATURES_TIMEOUT = void 0;
|
|
4
4
|
const utils_1 = require("@trezor/utils");
|
|
5
5
|
const protocol_1 = require("@trezor/protocol");
|
|
6
6
|
const DeviceCommands_1 = require("./DeviceCommands");
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
const events_1 = require("../events");
|
|
9
9
|
const coinInfo_1 = require("../data/coinInfo");
|
|
10
|
+
const DataManager_1 = require("../data/DataManager");
|
|
10
11
|
const firmwareInfo_1 = require("../data/firmwareInfo");
|
|
11
12
|
const deviceFeaturesUtils_1 = require("../utils/deviceFeaturesUtils");
|
|
12
13
|
const debug_1 = require("../utils/debug");
|
|
@@ -16,6 +17,7 @@ const models_1 = require("../data/models");
|
|
|
16
17
|
const getLanguage_1 = require("../data/getLanguage");
|
|
17
18
|
const _log = (0, debug_1.initLog)('Device');
|
|
18
19
|
exports.GET_FEATURES_TIMEOUT = 3000;
|
|
20
|
+
exports.GET_FEATURES_TIMEOUT_REACT_NATIVE = 20000;
|
|
19
21
|
const parseRunOptions = (options) => {
|
|
20
22
|
if (!options)
|
|
21
23
|
options = {};
|
|
@@ -172,12 +174,15 @@ class Device extends utils_1.TypedEmitter {
|
|
|
172
174
|
await this.acquire();
|
|
173
175
|
try {
|
|
174
176
|
if (fn) {
|
|
175
|
-
await this.initialize(!!options.
|
|
177
|
+
await this.initialize(!!options.useCardanoDerivation);
|
|
176
178
|
}
|
|
177
179
|
else {
|
|
180
|
+
const getFeaturesTimeout = DataManager_1.DataManager.getSettings('env') === 'react-native'
|
|
181
|
+
? exports.GET_FEATURES_TIMEOUT_REACT_NATIVE
|
|
182
|
+
: exports.GET_FEATURES_TIMEOUT;
|
|
178
183
|
await Promise.race([
|
|
179
184
|
this.getFeatures(),
|
|
180
|
-
new Promise((_resolve, reject) => setTimeout(() => reject(new Error('GetFeatures timeout')),
|
|
185
|
+
new Promise((_resolve, reject) => setTimeout(() => reject(new Error('GetFeatures timeout')), getFeaturesTimeout)),
|
|
181
186
|
]);
|
|
182
187
|
}
|
|
183
188
|
}
|
|
@@ -191,7 +196,7 @@ class Device extends utils_1.TypedEmitter {
|
|
|
191
196
|
}
|
|
192
197
|
this.inconsistent = true;
|
|
193
198
|
delete this.runPromise;
|
|
194
|
-
return Promise.reject(constants_1.ERRORS.TypedError('Device_InitializeFailed', `Initialize failed: ${error.message}
|
|
199
|
+
return Promise.reject(constants_1.ERRORS.TypedError('Device_InitializeFailed', `Initialize failed: ${error.message}${error.code ? `, code: ${error.code}` : ''}`));
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
if (options.keepSession) {
|
|
@@ -232,9 +237,6 @@ class Device extends utils_1.TypedEmitter {
|
|
|
232
237
|
this.activitySessionID = null;
|
|
233
238
|
this.keepSession = false;
|
|
234
239
|
}
|
|
235
|
-
if (this.isT1() && this.useLegacyPassphrase()) {
|
|
236
|
-
this.setInternalState(undefined);
|
|
237
|
-
}
|
|
238
240
|
}
|
|
239
241
|
this.instance = instance;
|
|
240
242
|
}
|
|
@@ -247,9 +249,6 @@ class Device extends utils_1.TypedEmitter {
|
|
|
247
249
|
}
|
|
248
250
|
else if (state !== this.internalState[this.instance]) {
|
|
249
251
|
this.internalState[this.instance] = state;
|
|
250
|
-
if (this.useLegacyPassphrase() && this.isT1()) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
252
|
this.emit(events_1.DEVICE.SAVE_STATE, state);
|
|
254
253
|
}
|
|
255
254
|
}
|
|
@@ -279,7 +278,7 @@ class Device extends utils_1.TypedEmitter {
|
|
|
279
278
|
const expectedState = this.getExternalState();
|
|
280
279
|
const state = await this.getCommands().getDeviceState();
|
|
281
280
|
const uniqueState = `${state}@${this.features.device_id || 'device_id'}:${this.instance}`;
|
|
282
|
-
if (
|
|
281
|
+
if (this.features.session_id) {
|
|
283
282
|
this.setInternalState(this.features.session_id);
|
|
284
283
|
}
|
|
285
284
|
if (expectedState && expectedState !== uniqueState) {
|
|
@@ -289,26 +288,15 @@ class Device extends utils_1.TypedEmitter {
|
|
|
289
288
|
this.setExternalState(uniqueState);
|
|
290
289
|
}
|
|
291
290
|
}
|
|
292
|
-
|
|
293
|
-
return !this.atLeast(['1.9.0', '2.3.0']);
|
|
294
|
-
}
|
|
295
|
-
async initialize(useEmptyPassphrase, useCardanoDerivation) {
|
|
291
|
+
async initialize(useCardanoDerivation) {
|
|
296
292
|
let payload;
|
|
297
293
|
if (this.features) {
|
|
298
|
-
const legacy = this.useLegacyPassphrase();
|
|
299
294
|
const internalState = this.getInternalState();
|
|
300
295
|
payload = {};
|
|
301
296
|
payload.derive_cardano = useCardanoDerivation;
|
|
302
|
-
if (
|
|
297
|
+
if (internalState) {
|
|
303
298
|
payload.session_id = internalState;
|
|
304
299
|
}
|
|
305
|
-
if (legacy && !this.isT1()) {
|
|
306
|
-
payload.session_id = internalState;
|
|
307
|
-
if (useEmptyPassphrase) {
|
|
308
|
-
payload._skip_passphrase = useEmptyPassphrase;
|
|
309
|
-
payload.session_id = undefined;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
300
|
}
|
|
313
301
|
const { message } = await this.getCommands().typedCall('Initialize', 'Features', payload);
|
|
314
302
|
this._updateFeatures(message);
|
|
@@ -340,6 +328,9 @@ class Device extends utils_1.TypedEmitter {
|
|
|
340
328
|
version: this.getVersion(),
|
|
341
329
|
internal_model: this.features.internal_model,
|
|
342
330
|
});
|
|
331
|
+
if (!downloadedBinary) {
|
|
332
|
+
throw constants_1.ERRORS.TypedError('Runtime', 'changeLanguage: translation not found');
|
|
333
|
+
}
|
|
343
334
|
return this._uploadTranslationData(downloadedBinary);
|
|
344
335
|
}
|
|
345
336
|
async _uploadTranslationData(payload) {
|