@trezor/connect 9.5.3 → 9.5.4
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 +38 -4
- package/README.md +1 -1
- package/lib/api/binance/api/binanceSignTransaction.js +1 -1
- package/lib/api/bitcoin/BitcoinFees.d.ts +4 -6
- package/lib/api/bitcoin/BitcoinFees.js +8 -2
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/bitcoin/signtxVerify.js +3 -3
- package/lib/api/blockchainEstimateFee.js +13 -13
- package/lib/api/cardano/api/cardanoSignTransaction.js +1 -1
- package/lib/api/common/Discovery.d.ts +4 -4
- package/lib/api/common/Discovery.js +3 -4
- package/lib/api/common/MiscFees.d.ts +5 -9
- package/lib/api/common/MiscFees.js +6 -21
- package/lib/api/composeTransaction.js +4 -3
- package/lib/api/eos/api/eosSignTransaction.js +1 -1
- package/lib/api/eos/eosSignTx.d.ts +2 -2
- package/lib/api/ethereum/EthereumFees.d.ts +5 -8
- package/lib/api/ethereum/EthereumFees.js +24 -38
- package/lib/api/ethereum/api/ethereumGetAddress.d.ts +1 -5
- package/lib/api/ethereum/api/ethereumGetAddress.js +7 -8
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +11 -7
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +12 -5
- package/lib/api/ethereum/api/ethereumSignTransaction.js +2 -2
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +2 -4
- package/lib/api/ethereum/api/ethereumSignTypedData.js +1 -1
- package/lib/api/firmware/uploadFirmware.d.ts +2 -2
- package/lib/api/getAccountDescriptor.js +1 -3
- package/lib/api/getAccountInfo.js +4 -9
- package/lib/api/getAddress.js +6 -7
- package/lib/api/getCoinInfo.d.ts +12 -18
- package/lib/api/getPublicKey.d.ts +11 -7
- package/lib/api/resetDevice.js +1 -3
- package/lib/api/signTransaction.js +3 -3
- package/lib/api/stellar/api/stellarSignTransaction.js +1 -1
- package/lib/constants/errors.d.ts +1 -2
- package/lib/constants/errors.js +8 -3
- package/lib/core/index.js +36 -15
- package/lib/core/onCallFirmwareUpdate.js +6 -3
- package/lib/data/coinInfo.d.ts +44 -66
- package/lib/data/config.d.ts +10 -0
- package/lib/data/config.js +10 -0
- package/lib/data/deviceAuthenticityConfig.js +4 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +82 -16
- package/lib/device/Device.js +51 -61
- package/lib/device/DeviceCommands.d.ts +37 -4549
- package/lib/device/DeviceCommands.js +55 -264
- package/lib/device/DeviceCurrentSession.d.ts +4531 -0
- package/lib/device/DeviceCurrentSession.js +209 -0
- package/lib/device/DeviceList.js +4 -6
- package/lib/device/TransportManager.d.ts +1 -1
- package/lib/device/TransportManager.js +5 -4
- package/lib/events/ui-response.d.ts +3 -3
- package/lib/impl/dynamic.d.ts +4 -1
- package/lib/impl/dynamic.js +17 -4
- package/lib/tsconfig.lib.tsbuildinfo +1 -1
- package/lib/types/api/getPublicKey.d.ts +5 -3
- package/lib/types/api/getPublicKey.js +13 -12
- package/lib/types/coinInfo.d.ts +12 -24
- package/lib/types/fees.d.ts +2 -11
- package/lib/types/fees.js +3 -11
- package/lib/utils/versionCheck.js +1 -1
- package/package.json +9 -9
- package/lib/device/prompts.d.ts +0 -866
- package/lib/device/prompts.js +0 -60
package/lib/data/coinInfo.d.ts
CHANGED
|
@@ -23,17 +23,15 @@ export declare const getBitcoinNetwork: (pathOrName: DerivationPath) => ({
|
|
|
23
23
|
};
|
|
24
24
|
decimals: number;
|
|
25
25
|
defaultFees: {
|
|
26
|
+
feePerTx?: string | undefined;
|
|
27
|
+
feeLimit?: string | undefined;
|
|
28
|
+
baseFeePerGas?: string | undefined;
|
|
26
29
|
maxFeePerGas?: string | undefined;
|
|
27
30
|
maxPriorityFeePerGas?: string | undefined;
|
|
28
31
|
maxWaitTimeEstimate?: number | undefined;
|
|
29
|
-
minWaitTimeEstimate?: number | undefined;
|
|
30
|
-
feeLimit?: string | undefined;
|
|
31
|
-
feePerTx?: string | undefined;
|
|
32
|
-
baseFeePerGas?: string | undefined;
|
|
33
|
-
effectiveGasPrice?: string | undefined;
|
|
34
32
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
35
|
-
feePerUnit: string;
|
|
36
33
|
blocks: number;
|
|
34
|
+
feePerUnit: string;
|
|
37
35
|
}[];
|
|
38
36
|
} & {
|
|
39
37
|
cashAddrPrefix?: string | undefined;
|
|
@@ -89,17 +87,15 @@ export declare const getEthereumNetwork: (pathOrNetworkSymbol: DerivationPath) =
|
|
|
89
87
|
};
|
|
90
88
|
decimals: number;
|
|
91
89
|
defaultFees: {
|
|
90
|
+
feePerTx?: string | undefined;
|
|
91
|
+
feeLimit?: string | undefined;
|
|
92
|
+
baseFeePerGas?: string | undefined;
|
|
92
93
|
maxFeePerGas?: string | undefined;
|
|
93
94
|
maxPriorityFeePerGas?: string | undefined;
|
|
94
95
|
maxWaitTimeEstimate?: number | undefined;
|
|
95
|
-
minWaitTimeEstimate?: number | undefined;
|
|
96
|
-
feeLimit?: string | undefined;
|
|
97
|
-
feePerTx?: string | undefined;
|
|
98
|
-
baseFeePerGas?: string | undefined;
|
|
99
|
-
effectiveGasPrice?: string | undefined;
|
|
100
96
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
101
|
-
feePerUnit: string;
|
|
102
97
|
blocks: number;
|
|
98
|
+
feePerUnit: string;
|
|
103
99
|
}[];
|
|
104
100
|
} & {
|
|
105
101
|
network?: undefined;
|
|
@@ -130,17 +126,15 @@ export declare const getMiscNetwork: (pathOrName: DerivationPath) => ({
|
|
|
130
126
|
};
|
|
131
127
|
decimals: number;
|
|
132
128
|
defaultFees: {
|
|
129
|
+
feePerTx?: string | undefined;
|
|
130
|
+
feeLimit?: string | undefined;
|
|
131
|
+
baseFeePerGas?: string | undefined;
|
|
133
132
|
maxFeePerGas?: string | undefined;
|
|
134
133
|
maxPriorityFeePerGas?: string | undefined;
|
|
135
134
|
maxWaitTimeEstimate?: number | undefined;
|
|
136
|
-
minWaitTimeEstimate?: number | undefined;
|
|
137
|
-
feeLimit?: string | undefined;
|
|
138
|
-
feePerTx?: string | undefined;
|
|
139
|
-
baseFeePerGas?: string | undefined;
|
|
140
|
-
effectiveGasPrice?: string | undefined;
|
|
141
135
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
142
|
-
feePerUnit: string;
|
|
143
136
|
blocks: number;
|
|
137
|
+
feePerUnit: string;
|
|
144
138
|
}[];
|
|
145
139
|
} & {
|
|
146
140
|
network?: undefined;
|
|
@@ -195,17 +189,15 @@ export declare const fixCoinInfoNetwork: (ci: BitcoinNetworkInfo, path: number[]
|
|
|
195
189
|
};
|
|
196
190
|
decimals: number;
|
|
197
191
|
defaultFees: {
|
|
192
|
+
feePerTx?: string | undefined;
|
|
193
|
+
feeLimit?: string | undefined;
|
|
194
|
+
baseFeePerGas?: string | undefined;
|
|
198
195
|
maxFeePerGas?: string | undefined;
|
|
199
196
|
maxPriorityFeePerGas?: string | undefined;
|
|
200
197
|
maxWaitTimeEstimate?: number | undefined;
|
|
201
|
-
minWaitTimeEstimate?: number | undefined;
|
|
202
|
-
feeLimit?: string | undefined;
|
|
203
|
-
feePerTx?: string | undefined;
|
|
204
|
-
baseFeePerGas?: string | undefined;
|
|
205
|
-
effectiveGasPrice?: string | undefined;
|
|
206
198
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
207
|
-
feePerUnit: string;
|
|
208
199
|
blocks: number;
|
|
200
|
+
feePerUnit: string;
|
|
209
201
|
}[];
|
|
210
202
|
} & {
|
|
211
203
|
cashAddrPrefix?: string | undefined;
|
|
@@ -261,17 +253,15 @@ export declare const getCoinInfoByHash: (hash: string, networkInfo: any) => {
|
|
|
261
253
|
};
|
|
262
254
|
decimals: number;
|
|
263
255
|
defaultFees: {
|
|
256
|
+
feePerTx?: string | undefined;
|
|
257
|
+
feeLimit?: string | undefined;
|
|
258
|
+
baseFeePerGas?: string | undefined;
|
|
264
259
|
maxFeePerGas?: string | undefined;
|
|
265
260
|
maxPriorityFeePerGas?: string | undefined;
|
|
266
261
|
maxWaitTimeEstimate?: number | undefined;
|
|
267
|
-
minWaitTimeEstimate?: number | undefined;
|
|
268
|
-
feeLimit?: string | undefined;
|
|
269
|
-
feePerTx?: string | undefined;
|
|
270
|
-
baseFeePerGas?: string | undefined;
|
|
271
|
-
effectiveGasPrice?: string | undefined;
|
|
272
262
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
273
|
-
feePerUnit: string;
|
|
274
263
|
blocks: number;
|
|
264
|
+
feePerUnit: string;
|
|
275
265
|
}[];
|
|
276
266
|
} & {
|
|
277
267
|
cashAddrPrefix?: string | undefined;
|
|
@@ -327,17 +317,15 @@ export declare const getCoinInfo: (currency: string) => ({
|
|
|
327
317
|
};
|
|
328
318
|
decimals: number;
|
|
329
319
|
defaultFees: {
|
|
320
|
+
feePerTx?: string | undefined;
|
|
321
|
+
feeLimit?: string | undefined;
|
|
322
|
+
baseFeePerGas?: string | undefined;
|
|
330
323
|
maxFeePerGas?: string | undefined;
|
|
331
324
|
maxPriorityFeePerGas?: string | undefined;
|
|
332
325
|
maxWaitTimeEstimate?: number | undefined;
|
|
333
|
-
minWaitTimeEstimate?: number | undefined;
|
|
334
|
-
feeLimit?: string | undefined;
|
|
335
|
-
feePerTx?: string | undefined;
|
|
336
|
-
baseFeePerGas?: string | undefined;
|
|
337
|
-
effectiveGasPrice?: string | undefined;
|
|
338
326
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
339
|
-
feePerUnit: string;
|
|
340
327
|
blocks: number;
|
|
328
|
+
feePerUnit: string;
|
|
341
329
|
}[];
|
|
342
330
|
} & {
|
|
343
331
|
cashAddrPrefix?: string | undefined;
|
|
@@ -392,17 +380,15 @@ export declare const getCoinInfo: (currency: string) => ({
|
|
|
392
380
|
};
|
|
393
381
|
decimals: number;
|
|
394
382
|
defaultFees: {
|
|
383
|
+
feePerTx?: string | undefined;
|
|
384
|
+
feeLimit?: string | undefined;
|
|
385
|
+
baseFeePerGas?: string | undefined;
|
|
395
386
|
maxFeePerGas?: string | undefined;
|
|
396
387
|
maxPriorityFeePerGas?: string | undefined;
|
|
397
388
|
maxWaitTimeEstimate?: number | undefined;
|
|
398
|
-
minWaitTimeEstimate?: number | undefined;
|
|
399
|
-
feeLimit?: string | undefined;
|
|
400
|
-
feePerTx?: string | undefined;
|
|
401
|
-
baseFeePerGas?: string | undefined;
|
|
402
|
-
effectiveGasPrice?: string | undefined;
|
|
403
389
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
404
|
-
feePerUnit: string;
|
|
405
390
|
blocks: number;
|
|
391
|
+
feePerUnit: string;
|
|
406
392
|
}[];
|
|
407
393
|
} & {
|
|
408
394
|
network?: undefined;
|
|
@@ -432,17 +418,15 @@ export declare const getCoinInfo: (currency: string) => ({
|
|
|
432
418
|
};
|
|
433
419
|
decimals: number;
|
|
434
420
|
defaultFees: {
|
|
421
|
+
feePerTx?: string | undefined;
|
|
422
|
+
feeLimit?: string | undefined;
|
|
423
|
+
baseFeePerGas?: string | undefined;
|
|
435
424
|
maxFeePerGas?: string | undefined;
|
|
436
425
|
maxPriorityFeePerGas?: string | undefined;
|
|
437
426
|
maxWaitTimeEstimate?: number | undefined;
|
|
438
|
-
minWaitTimeEstimate?: number | undefined;
|
|
439
|
-
feeLimit?: string | undefined;
|
|
440
|
-
feePerTx?: string | undefined;
|
|
441
|
-
baseFeePerGas?: string | undefined;
|
|
442
|
-
effectiveGasPrice?: string | undefined;
|
|
443
427
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
444
|
-
feePerUnit: string;
|
|
445
428
|
blocks: number;
|
|
429
|
+
feePerUnit: string;
|
|
446
430
|
}[];
|
|
447
431
|
} & {
|
|
448
432
|
network?: undefined;
|
|
@@ -482,17 +466,15 @@ export declare const getAllNetworks: () => (({
|
|
|
482
466
|
};
|
|
483
467
|
decimals: number;
|
|
484
468
|
defaultFees: {
|
|
469
|
+
feePerTx?: string | undefined;
|
|
470
|
+
feeLimit?: string | undefined;
|
|
471
|
+
baseFeePerGas?: string | undefined;
|
|
485
472
|
maxFeePerGas?: string | undefined;
|
|
486
473
|
maxPriorityFeePerGas?: string | undefined;
|
|
487
474
|
maxWaitTimeEstimate?: number | undefined;
|
|
488
|
-
minWaitTimeEstimate?: number | undefined;
|
|
489
|
-
feeLimit?: string | undefined;
|
|
490
|
-
feePerTx?: string | undefined;
|
|
491
|
-
baseFeePerGas?: string | undefined;
|
|
492
|
-
effectiveGasPrice?: string | undefined;
|
|
493
475
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
494
|
-
feePerUnit: string;
|
|
495
476
|
blocks: number;
|
|
477
|
+
feePerUnit: string;
|
|
496
478
|
}[];
|
|
497
479
|
} & {
|
|
498
480
|
cashAddrPrefix?: string | undefined;
|
|
@@ -547,17 +529,15 @@ export declare const getAllNetworks: () => (({
|
|
|
547
529
|
};
|
|
548
530
|
decimals: number;
|
|
549
531
|
defaultFees: {
|
|
532
|
+
feePerTx?: string | undefined;
|
|
533
|
+
feeLimit?: string | undefined;
|
|
534
|
+
baseFeePerGas?: string | undefined;
|
|
550
535
|
maxFeePerGas?: string | undefined;
|
|
551
536
|
maxPriorityFeePerGas?: string | undefined;
|
|
552
537
|
maxWaitTimeEstimate?: number | undefined;
|
|
553
|
-
minWaitTimeEstimate?: number | undefined;
|
|
554
|
-
feeLimit?: string | undefined;
|
|
555
|
-
feePerTx?: string | undefined;
|
|
556
|
-
baseFeePerGas?: string | undefined;
|
|
557
|
-
effectiveGasPrice?: string | undefined;
|
|
558
538
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
559
|
-
feePerUnit: string;
|
|
560
539
|
blocks: number;
|
|
540
|
+
feePerUnit: string;
|
|
561
541
|
}[];
|
|
562
542
|
} & {
|
|
563
543
|
network?: undefined;
|
|
@@ -587,17 +567,15 @@ export declare const getAllNetworks: () => (({
|
|
|
587
567
|
};
|
|
588
568
|
decimals: number;
|
|
589
569
|
defaultFees: {
|
|
570
|
+
feePerTx?: string | undefined;
|
|
571
|
+
feeLimit?: string | undefined;
|
|
572
|
+
baseFeePerGas?: string | undefined;
|
|
590
573
|
maxFeePerGas?: string | undefined;
|
|
591
574
|
maxPriorityFeePerGas?: string | undefined;
|
|
592
575
|
maxWaitTimeEstimate?: number | undefined;
|
|
593
|
-
minWaitTimeEstimate?: number | undefined;
|
|
594
|
-
feeLimit?: string | undefined;
|
|
595
|
-
feePerTx?: string | undefined;
|
|
596
|
-
baseFeePerGas?: string | undefined;
|
|
597
|
-
effectiveGasPrice?: string | undefined;
|
|
598
576
|
label: "normal" | "custom" | "high" | "economy" | "low";
|
|
599
|
-
feePerUnit: string;
|
|
600
577
|
blocks: number;
|
|
578
|
+
feePerUnit: string;
|
|
601
579
|
}[];
|
|
602
580
|
} & {
|
|
603
581
|
network?: undefined;
|
package/lib/data/config.d.ts
CHANGED
|
@@ -24,6 +24,11 @@ export declare const config: {
|
|
|
24
24
|
download: string;
|
|
25
25
|
update: string;
|
|
26
26
|
};
|
|
27
|
+
mobilechrome: {
|
|
28
|
+
version: number;
|
|
29
|
+
download: string;
|
|
30
|
+
update: string;
|
|
31
|
+
};
|
|
27
32
|
chromium: {
|
|
28
33
|
version: number;
|
|
29
34
|
download: string;
|
|
@@ -39,6 +44,11 @@ export declare const config: {
|
|
|
39
44
|
download: string;
|
|
40
45
|
update: string;
|
|
41
46
|
};
|
|
47
|
+
mobilefirefox: {
|
|
48
|
+
version: number;
|
|
49
|
+
download: string;
|
|
50
|
+
update: string;
|
|
51
|
+
};
|
|
42
52
|
brave: {
|
|
43
53
|
version: number;
|
|
44
54
|
download: string;
|
package/lib/data/config.js
CHANGED
|
@@ -72,6 +72,11 @@ exports.config = {
|
|
|
72
72
|
download: 'https://www.google.com/chrome/',
|
|
73
73
|
update: 'https://support.google.com/chrome/answer/95414',
|
|
74
74
|
},
|
|
75
|
+
mobilechrome: {
|
|
76
|
+
version: 59,
|
|
77
|
+
download: 'https://www.google.com/chrome/',
|
|
78
|
+
update: 'https://support.google.com/chrome/answer/95414',
|
|
79
|
+
},
|
|
75
80
|
chromium: {
|
|
76
81
|
version: 59,
|
|
77
82
|
download: 'https://www.chromium.org/',
|
|
@@ -87,6 +92,11 @@ exports.config = {
|
|
|
87
92
|
download: 'https://www.mozilla.org/en-US/firefox/new/',
|
|
88
93
|
update: 'https://support.mozilla.org/en-US/kb/update-firefox-latest-version',
|
|
89
94
|
},
|
|
95
|
+
mobilefirefox: {
|
|
96
|
+
version: 54,
|
|
97
|
+
download: 'https://www.mozilla.org/en-US/firefox/new/',
|
|
98
|
+
update: 'https://support.mozilla.org/en-US/kb/update-firefox-latest-version',
|
|
99
|
+
},
|
|
90
100
|
brave: {
|
|
91
101
|
version: 59,
|
|
92
102
|
download: 'https://brave.com/download/',
|
|
@@ -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-03-
|
|
6
|
+
timestamp: '2025-03-26T12:00:00.000Z',
|
|
7
7
|
T2B1: {
|
|
8
8
|
rootPubKeys: [
|
|
9
9
|
'04ca97480ac0d7b1e6efafe518cd433cec2bf8ab9822d76eafd34363b55d63e60380bff20acc75cde03cffcb50ab6f8ce70c878e37ebc58ff7cca0a83b16b15fa5',
|
|
@@ -84,6 +84,9 @@ exports.deviceAuthenticityConfig = {
|
|
|
84
84
|
'04221f144939e3201538d02b61a4b419b12678dc27ccd3813bfda29f181ba7160807e7a3c6f3938b12e6a9e7e76314fd13757a39454b93e3d1a28c633cbf475c0f',
|
|
85
85
|
'0471515c2c4b94274ec0b3b1d799378730010fb6b5b738d9ef2087e930d0f75d53b1e5284ed51335f45b7b30973af848a40ad86dbe34962dfee6a019d32f5b21dd',
|
|
86
86
|
'04f9f46d57a7bb9d2ac2e9121eb85f6e9a2a7e2b395ec6e7f93660e5caac2f64483dae074bd5b7e7d8057b2732b3dff5d861eefc5ab86059483d3374d527c877f1',
|
|
87
|
+
'040abd7641975f6dab835e9189ba2e2f5e19feeef3eb43d3e940f903be7ddb6317450c6c0f40094584dfe8aea75f086e850b2b362982fdca684fbd07720e1482d9',
|
|
88
|
+
'049e189082b8a35e4f46577d62fe15b76a713e9ef54f80c1aee33db05890048af5886518d643715a439ce3eead5dac6cbe1fbde26bf09ea083eccc7e8c1098c3dc',
|
|
89
|
+
'04be948fcc006a7d719d89019a446a8f9ff298410d203db096cbd76383b3807f3d4927ef5db437b99696edbed37829b03235f49f25603bed32d7eee2c49ede403b',
|
|
87
90
|
],
|
|
88
91
|
debug: {
|
|
89
92
|
rootPubKeys: [],
|
package/lib/data/version.d.ts
CHANGED
package/lib/data/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEEPLINK_VERSION = exports.CONTENT_SCRIPT_VERSION = exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '9.5.
|
|
4
|
+
exports.VERSION = '9.5.4';
|
|
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
|
package/lib/device/Device.d.ts
CHANGED
|
@@ -2,10 +2,9 @@ import { TransportProtocol } from '@trezor/protocol';
|
|
|
2
2
|
import { Session } from '@trezor/transport';
|
|
3
3
|
import { type Descriptor, type Transport } from '@trezor/transport';
|
|
4
4
|
import { TypedEmitter } from '@trezor/utils';
|
|
5
|
-
import { DeviceCommands } from './DeviceCommands';
|
|
6
5
|
import { PROTO } from '../constants';
|
|
6
|
+
import { TypedCallProvider } from './DeviceCurrentSession';
|
|
7
7
|
import { IStateStorage } from './StateStorage';
|
|
8
|
-
import type { PromptCallback } from './prompts';
|
|
9
8
|
import { DEVICE, DeviceButtonRequestPayload, DeviceVersionChanged, UiResponsePassphrase, UiResponsePin, UiResponseWord } from '../events';
|
|
10
9
|
import { DeviceFirmwareStatus, DeviceState, Device as DeviceTyped, DeviceUniquePath, FirmwareType, ReleaseInfo, UnavailableCapabilities, VersionArray } from '../types';
|
|
11
10
|
type RunOptions = {
|
|
@@ -18,20 +17,24 @@ type RunOptions = {
|
|
|
18
17
|
export declare const CANCEL_TIMEOUT = 1000;
|
|
19
18
|
export declare const GET_FEATURES_TIMEOUT = 3000;
|
|
20
19
|
export declare const GET_FEATURES_TIMEOUT_REACT_NATIVE = 20000;
|
|
20
|
+
type Result<T> = {
|
|
21
|
+
success: true;
|
|
22
|
+
payload: T;
|
|
23
|
+
} | {
|
|
24
|
+
success: false;
|
|
25
|
+
error: Error;
|
|
26
|
+
};
|
|
21
27
|
export interface DeviceEvents {
|
|
22
28
|
[DEVICE.PIN]: {
|
|
23
|
-
device: Device;
|
|
24
29
|
type: PROTO.PinMatrixRequestType | undefined;
|
|
25
|
-
callback:
|
|
30
|
+
callback: (response: Result<UiResponsePin['payload']>) => void;
|
|
26
31
|
};
|
|
27
32
|
[DEVICE.WORD]: {
|
|
28
|
-
device: Device;
|
|
29
33
|
type: PROTO.WordRequestType;
|
|
30
|
-
callback:
|
|
34
|
+
callback: (response: Result<UiResponseWord['payload']>) => void;
|
|
31
35
|
};
|
|
32
36
|
[DEVICE.PASSPHRASE]: {
|
|
33
|
-
|
|
34
|
-
callback: PromptCallback<UiResponsePassphrase['payload']>;
|
|
37
|
+
callback: (response: Result<UiResponsePassphrase['payload']>) => void;
|
|
35
38
|
};
|
|
36
39
|
[DEVICE.PASSPHRASE_ON_DEVICE]: void;
|
|
37
40
|
[DEVICE.BUTTON]: {
|
|
@@ -52,10 +55,10 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
52
55
|
readonly transport: Transport;
|
|
53
56
|
readonly protocol: TransportProtocol;
|
|
54
57
|
readonly transportPath: import("@trezor/transport/lib/types").PathPublic;
|
|
55
|
-
private readonly transportSessionOwner;
|
|
56
58
|
private readonly transportDescriptorType;
|
|
57
59
|
private readonly bluetoothProps;
|
|
58
60
|
private session;
|
|
61
|
+
private transportSessionOwner;
|
|
59
62
|
private lastAcquiredHere;
|
|
60
63
|
private unreadableError?;
|
|
61
64
|
private _firmwareStatus;
|
|
@@ -122,8 +125,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
122
125
|
private releasePromise?;
|
|
123
126
|
private runPromise?;
|
|
124
127
|
private keepTransportSession;
|
|
125
|
-
|
|
126
|
-
private cancelableAction?;
|
|
128
|
+
private currentSession?;
|
|
127
129
|
private loaded;
|
|
128
130
|
private inconsistent;
|
|
129
131
|
private firstRunPromise;
|
|
@@ -157,12 +159,76 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
157
159
|
updateDescriptor(descriptor: Descriptor): Promise<void>;
|
|
158
160
|
run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
|
|
159
161
|
override(error: Error): Promise<void>;
|
|
160
|
-
setCancelableAction(callback: NonNullable<typeof this.cancelableAction>): void;
|
|
161
|
-
clearCancelableAction(): void;
|
|
162
162
|
interruptionFromUser(error: Error): Promise<void>;
|
|
163
163
|
usedElsewhere(): void;
|
|
164
164
|
private _runInner;
|
|
165
|
-
|
|
165
|
+
getCurrentSession(): TypedCallProvider;
|
|
166
|
+
getCommands(): {
|
|
167
|
+
unlockPath: (params?: PROTO.UnlockPath) => Promise<{
|
|
168
|
+
type: "UnlockedPathRequest";
|
|
169
|
+
message: {
|
|
170
|
+
mac: string;
|
|
171
|
+
};
|
|
172
|
+
}>;
|
|
173
|
+
getPublicKey: (params: PROTO.GetPublicKey, unlock?: PROTO.UnlockPath) => Promise<{
|
|
174
|
+
descriptor?: string | undefined;
|
|
175
|
+
root_fingerprint?: number | undefined;
|
|
176
|
+
node: {
|
|
177
|
+
private_key?: string | undefined;
|
|
178
|
+
public_key: string;
|
|
179
|
+
depth: number;
|
|
180
|
+
fingerprint: number;
|
|
181
|
+
child_num: number;
|
|
182
|
+
chain_code: string;
|
|
183
|
+
};
|
|
184
|
+
xpub: string;
|
|
185
|
+
}>;
|
|
186
|
+
getAddress: ({ address_n, show_display, multisig, script_type, chunkify }: PROTO.GetAddress, coinInfo: import("../types").BitcoinNetworkInfo) => Promise<{
|
|
187
|
+
mac?: string | undefined;
|
|
188
|
+
address: string;
|
|
189
|
+
}>;
|
|
190
|
+
ethereumGetPublicKey: ({ address_n, show_display, }: PROTO.EthereumGetPublicKey) => Promise<{
|
|
191
|
+
node: {
|
|
192
|
+
private_key?: string | undefined;
|
|
193
|
+
public_key: string;
|
|
194
|
+
depth: number;
|
|
195
|
+
fingerprint: number;
|
|
196
|
+
child_num: number;
|
|
197
|
+
chain_code: string;
|
|
198
|
+
};
|
|
199
|
+
xpub: string;
|
|
200
|
+
}>;
|
|
201
|
+
ethereumGetAddress: (params: PROTO.EthereumGetAddress) => Promise<{
|
|
202
|
+
_old_address?: string | undefined;
|
|
203
|
+
address: string;
|
|
204
|
+
}>;
|
|
205
|
+
getHDNode: (params: PROTO.GetPublicKey, options: {
|
|
206
|
+
coinInfo: import("../types").BitcoinNetworkInfo;
|
|
207
|
+
validation?: boolean;
|
|
208
|
+
unlockPath?: PROTO.UnlockPath;
|
|
209
|
+
}) => Promise<{
|
|
210
|
+
path: number[];
|
|
211
|
+
publicKey: string;
|
|
212
|
+
serializedPath: string;
|
|
213
|
+
} & {
|
|
214
|
+
descriptor?: string | undefined;
|
|
215
|
+
xpubSegwit?: string | undefined;
|
|
216
|
+
descriptorChecksum?: string | undefined;
|
|
217
|
+
depth: number;
|
|
218
|
+
fingerprint: number;
|
|
219
|
+
chainCode: string;
|
|
220
|
+
childNum: number;
|
|
221
|
+
xpub: string;
|
|
222
|
+
}>;
|
|
223
|
+
preauthorize: (throwError: boolean) => Promise<boolean>;
|
|
224
|
+
getAccountDescriptor: (coinInfo: import("../types").CoinInfo, indexOrPath: number | number[], derivationType?: PROTO.CardanoDerivationType) => Promise<{
|
|
225
|
+
descriptor: string;
|
|
226
|
+
legacyXpub?: string;
|
|
227
|
+
address_n: number[];
|
|
228
|
+
descriptorChecksum?: string;
|
|
229
|
+
}>;
|
|
230
|
+
typedCall: PROTO.TypedCall;
|
|
231
|
+
};
|
|
166
232
|
setInstance(instance?: number): void;
|
|
167
233
|
getInstance(): number;
|
|
168
234
|
getState(): DeviceState | undefined;
|
|
@@ -186,6 +252,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
186
252
|
}>;
|
|
187
253
|
private _uploadTranslationData;
|
|
188
254
|
private _updateFeatures;
|
|
255
|
+
prompt<T extends typeof DEVICE.PIN | typeof DEVICE.PASSPHRASE | typeof DEVICE.WORD>(type: T, args: Omit<DeviceEvents[T], 'callback'>): Promise<Parameters<DeviceEvents[T]["callback"]>[0]>;
|
|
189
256
|
isUnacquired(): boolean;
|
|
190
257
|
isUnreadable(): boolean;
|
|
191
258
|
disconnect(): Promise<void>;
|
|
@@ -201,11 +268,10 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
201
268
|
isRunning(): boolean;
|
|
202
269
|
isLoaded(): boolean;
|
|
203
270
|
waitForFirstRun(): Promise<boolean>;
|
|
204
|
-
getLocalSession(): Session | null;
|
|
205
271
|
getUniquePath(): DeviceUniquePath;
|
|
206
272
|
isT1(): boolean;
|
|
207
273
|
hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
|
|
208
|
-
dispose():
|
|
274
|
+
dispose(): void;
|
|
209
275
|
private getMode;
|
|
210
276
|
toMessageObject(): DeviceTyped;
|
|
211
277
|
}
|