@trezor/connect 9.3.1-beta.3 → 9.4.1-beta.1
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 +158 -102
- package/README.md +1 -1
- package/lib/api/binance/api/index.js +4 -6
- package/lib/api/bitcoin/Fees.d.ts +2 -2
- package/lib/api/bitcoin/outputs.d.ts +1 -1
- package/lib/api/bitcoin/refTx.d.ts +2 -2
- package/lib/api/cardano/api/index.js +6 -8
- package/lib/api/cardano/cardanoInputs.d.ts +10 -10
- package/lib/api/cardano/cardanoOutputs.d.ts +23 -23
- package/lib/api/cardano/cardanoTokenBundle.d.ts +6 -6
- package/lib/api/common/Discovery.d.ts +0 -1
- package/lib/api/common/paramsValidator.js +2 -2
- package/lib/api/composeTransaction.js +3 -0
- package/lib/api/eos/api/index.js +3 -5
- package/lib/api/eos/eosSignTx.d.ts +4 -4
- package/lib/api/eos/eosSignTx.js +2 -2
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +68 -68
- package/lib/api/ethereum/api/index.js +7 -9
- package/lib/api/ethereum/ethereumDefinitions.d.ts +23 -23
- package/lib/api/ethereum/ethereumSignTypedData.js +3 -4
- package/lib/api/firmware/calculateFirmwareHash.d.ts +0 -1
- package/lib/api/firmware/parseFirmwareHeaders.d.ts +0 -1
- package/lib/api/firmware/uploadFirmware.d.ts +6 -1
- package/lib/api/firmware/verifyAuthenticityProof.d.ts +0 -1
- package/lib/api/getAccountInfo.d.ts +38 -38
- package/lib/api/getCoinInfo.d.ts +3 -3
- package/lib/api/getDeviceState.d.ts +2 -1
- package/lib/api/getDeviceState.js +6 -3
- package/lib/api/getFeatures.d.ts +10 -10
- package/lib/api/index.js +49 -51
- package/lib/api/nem/api/index.js +3 -5
- package/lib/api/pushTransaction.js +1 -1
- package/lib/api/ripple/api/index.js +3 -5
- package/lib/api/signTransaction.js +3 -0
- package/lib/api/solana/api/index.js +4 -6
- package/lib/api/stellar/api/index.js +3 -5
- package/lib/api/tezos/api/index.js +4 -6
- package/lib/api/tezos/tezosSignTx.js +2 -2
- package/lib/backend/Blockchain.d.ts +2 -2
- package/lib/backend/BlockchainLink.d.ts +2 -2
- package/lib/constants/nem.d.ts +3 -3
- package/lib/core/AbstractMethod.d.ts +8 -6
- package/lib/core/AbstractMethod.js +26 -3
- package/lib/core/index.d.ts +0 -1
- package/lib/core/index.js +45 -54
- package/lib/core/onCallFirmwareUpdate.js +7 -2
- package/lib/data/DataManager.d.ts +5 -31
- package/lib/data/coinInfo.d.ts +15 -21
- package/lib/data/config.d.ts +5 -31
- package/lib/data/config.js +8 -5
- package/lib/data/deviceAuthenticityConfig.js +32 -14
- package/lib/data/deviceAuthenticityConfigTypes.d.ts +28 -28
- package/lib/data/firmwareInfo.d.ts +2 -2
- package/lib/data/firmwareInfo.js +8 -7
- package/lib/data/models.js +3 -3
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +52 -19
- package/lib/device/Device.js +87 -73
- package/lib/device/DeviceCommands.d.ts +9 -9
- package/lib/device/DeviceCommands.js +10 -10
- package/lib/device/DeviceList.js +60 -83
- package/lib/device/StateStorage.d.ts +15 -0
- package/lib/device/StateStorage.js +40 -0
- package/lib/device/checkFirmwareRevision.js +0 -4
- package/lib/events/device.d.ts +0 -1
- package/lib/events/device.js +0 -1
- package/lib/events/ui-request.d.ts +2 -1
- package/lib/factory.d.ts +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/types/api/applySettings.d.ts +14 -14
- package/lib/types/api/authenticateDevice.d.ts +30 -30
- package/lib/types/api/authorizeCoinjoin.d.ts +10 -10
- package/lib/types/api/binance/index.d.ts +152 -152
- package/lib/types/api/bitcoin/index.d.ts +12 -12
- package/lib/types/api/cancelCoinjoinAuthorization.d.ts +2 -2
- package/lib/types/api/cardano/index.d.ts +556 -556
- package/lib/types/api/changeLanguage.d.ts +7 -7
- package/lib/types/api/cipherKeyValue.d.ts +8 -8
- package/lib/types/api/eos/index.d.ts +633 -633
- package/lib/types/api/ethereum/index.d.ts +124 -124
- package/lib/types/api/firmwareUpdate.d.ts +6 -6
- package/lib/types/api/getAccountDescriptor.d.ts +5 -5
- package/lib/types/api/getAddress.d.ts +33 -33
- package/lib/types/api/getDeviceState.d.ts +3 -1
- package/lib/types/api/getOwnershipId.d.ts +25 -25
- package/lib/types/api/getOwnershipProof.d.ts +29 -29
- package/lib/types/api/getPublicKey.d.ts +25 -25
- package/lib/types/api/nem/index.d.ts +707 -707
- package/lib/types/api/nemGetAddress.d.ts +7 -7
- package/lib/types/api/pushTransaction.d.ts +4 -4
- package/lib/types/api/recoveryDevice.d.ts +10 -10
- package/lib/types/api/requestLogin.d.ts +28 -28
- package/lib/types/api/ripple/index.d.ts +28 -28
- package/lib/types/api/solana/index.d.ts +28 -28
- package/lib/types/api/stellar/index.d.ts +745 -745
- package/lib/types/api/tezos/index.d.ts +129 -129
- package/lib/types/api/unlockPath.d.ts +3 -3
- package/lib/types/coinInfo.d.ts +246 -246
- package/lib/types/device.d.ts +9 -1
- package/lib/types/fees.d.ts +22 -22
- package/lib/types/firmware.d.ts +1 -1
- package/lib/types/params.d.ts +20 -19
- package/lib/utils/assetUtils.js +1 -1
- package/lib/utils/assets-browser.d.ts +1 -1
- package/lib/utils/assets.js +1 -2
- package/lib/utils/debug.d.ts +2 -2
- package/lib/utils/deviceFeaturesUtils.d.ts +1 -1
- package/lib/utils/hdnodeUtils.d.ts +1 -191
- package/lib/utils/hdnodeUtils.js +2 -2
- package/lib/utils/pathUtils.d.ts +1 -191
- package/lib/utils/promiseUtils.d.ts +1 -1
- package/lib/utils/uiPromiseManager.d.ts +2 -2
- package/package.json +17 -15
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { Static } from '@trezor/schema-utils';
|
|
2
2
|
export type DeviceAuthenticityConfig = Static<typeof DeviceAuthenticityConfig>;
|
|
3
|
-
export declare const DeviceAuthenticityConfig: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TIntersect<[import("@
|
|
4
|
-
T2B1: import("@sinclair/typebox").TIntersect<[import("@
|
|
5
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
6
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
7
|
-
}>, import("@
|
|
8
|
-
debug: import("@sinclair/typebox").TOptional<import("@
|
|
9
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
10
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
3
|
+
export declare const DeviceAuthenticityConfig: import("@sinclair/typebox/build/esm/index.mjs").TIntersect<[import("@sinclair/typebox/build/esm/index.mjs").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
4
|
+
T2B1: import("@sinclair/typebox/build/esm/index.mjs").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
5
|
+
rootPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
6
|
+
caPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
7
|
+
}>, import("@trezor/schema-utils").TObject<{
|
|
8
|
+
debug: import("@sinclair/typebox/build/esm/index.mjs").TOptional<import("@trezor/schema-utils").TObject<{
|
|
9
|
+
rootPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
10
|
+
caPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
11
11
|
}>>;
|
|
12
12
|
}>]>;
|
|
13
|
-
T3B1: import("@sinclair/typebox").TIntersect<[import("@
|
|
14
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
15
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
16
|
-
}>, import("@
|
|
17
|
-
debug: import("@sinclair/typebox").TOptional<import("@
|
|
18
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
19
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
13
|
+
T3B1: import("@sinclair/typebox/build/esm/index.mjs").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
14
|
+
rootPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
15
|
+
caPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
16
|
+
}>, import("@trezor/schema-utils").TObject<{
|
|
17
|
+
debug: import("@sinclair/typebox/build/esm/index.mjs").TOptional<import("@trezor/schema-utils").TObject<{
|
|
18
|
+
rootPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
19
|
+
caPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
20
20
|
}>>;
|
|
21
21
|
}>]>;
|
|
22
|
-
T3T1: import("@sinclair/typebox").TIntersect<[import("@
|
|
23
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
24
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
25
|
-
}>, import("@
|
|
26
|
-
debug: import("@sinclair/typebox").TOptional<import("@
|
|
27
|
-
rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
28
|
-
caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
22
|
+
T3T1: import("@sinclair/typebox/build/esm/index.mjs").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
23
|
+
rootPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
24
|
+
caPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
25
|
+
}>, import("@trezor/schema-utils").TObject<{
|
|
26
|
+
debug: import("@sinclair/typebox/build/esm/index.mjs").TOptional<import("@trezor/schema-utils").TObject<{
|
|
27
|
+
rootPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
28
|
+
caPubKeys: import("@sinclair/typebox/build/esm/index.mjs").TArray<import("@sinclair/typebox/build/esm/index.mjs").TString>;
|
|
29
29
|
}>>;
|
|
30
30
|
}>]>;
|
|
31
|
-
}>, import("@
|
|
32
|
-
T1B1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
|
|
33
|
-
T2T1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
|
|
34
|
-
}>]>, import("@
|
|
35
|
-
version: import("@sinclair/typebox").TNumber;
|
|
36
|
-
timestamp: import("@sinclair/typebox").TString;
|
|
31
|
+
}>, import("@trezor/schema-utils").TObject<{
|
|
32
|
+
T1B1: import("@sinclair/typebox/build/esm/index.mjs").TOptional<import("@sinclair/typebox/build/esm/index.mjs").TUndefined>;
|
|
33
|
+
T2T1: import("@sinclair/typebox/build/esm/index.mjs").TOptional<import("@sinclair/typebox/build/esm/index.mjs").TUndefined>;
|
|
34
|
+
}>]>, import("@trezor/schema-utils").TObject<{
|
|
35
|
+
version: import("@sinclair/typebox/build/esm/index.mjs").TNumber;
|
|
36
|
+
timestamp: import("@sinclair/typebox/build/esm/index.mjs").TString;
|
|
37
37
|
}>]>;
|
|
38
38
|
//# sourceMappingURL=deviceAuthenticityConfigTypes.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Features, FirmwareRelease, ReleaseInfo } from '../types';
|
|
2
2
|
import { DeviceModelInternal } from '../types';
|
|
3
3
|
export declare const parseFirmware: (json: any, deviceModel: DeviceModelInternal) => void;
|
|
4
|
+
export declare const getReleases: (deviceModel: DeviceModelInternal) => FirmwareRelease[];
|
|
4
5
|
export interface GetInfoProps {
|
|
5
6
|
features: Features;
|
|
6
7
|
releases: FirmwareRelease[];
|
|
7
8
|
}
|
|
8
9
|
export declare const getInfo: ({ features, releases }: GetInfoProps) => ReleaseInfo | null;
|
|
9
|
-
export declare const getFirmwareStatus: (features: Features) => "
|
|
10
|
+
export declare const getFirmwareStatus: (features: Features) => "valid" | "outdated" | "required" | "unknown" | "custom" | "none";
|
|
10
11
|
export declare const getRelease: (features: Features) => ReleaseInfo | null;
|
|
11
|
-
export declare const getReleases: (deviceModel: DeviceModelInternal) => FirmwareRelease[];
|
|
12
12
|
//# sourceMappingURL=firmwareInfo.d.ts.map
|
package/lib/data/firmwareInfo.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getRelease = exports.getFirmwareStatus = exports.getInfo = exports.getReleases = exports.parseFirmware = void 0;
|
|
4
4
|
const utils_1 = require("@trezor/utils");
|
|
5
5
|
const firmwareUtils_1 = require("../utils/firmwareUtils");
|
|
6
6
|
const types_1 = require("../types");
|
|
7
7
|
const releases = Object.values(types_1.DeviceModelInternal).reduce((acc, key) => ({ ...acc, [key]: [] }), {});
|
|
8
8
|
const parseFirmware = (json, deviceModel) => {
|
|
9
9
|
Object.keys(json).forEach(key => {
|
|
10
|
+
var _a;
|
|
10
11
|
const release = json[key];
|
|
11
|
-
releases[deviceModel].push({
|
|
12
|
+
(_a = releases[deviceModel]) === null || _a === void 0 ? void 0 : _a.push({
|
|
12
13
|
...release,
|
|
13
14
|
});
|
|
14
15
|
});
|
|
15
16
|
};
|
|
16
17
|
exports.parseFirmware = parseFirmware;
|
|
18
|
+
const getReleases = (deviceModel) => releases[deviceModel] || [];
|
|
19
|
+
exports.getReleases = getReleases;
|
|
17
20
|
const getChangelog = (releases, features) => {
|
|
18
21
|
if (features.bootloader_mode) {
|
|
19
22
|
if (features.firmware_present && features.major_version === 1) {
|
|
@@ -91,7 +94,7 @@ const getSafeReleases = ({ features, releases }) => {
|
|
|
91
94
|
return (0, firmwareUtils_1.filterSafeListByFirmware)(releases, firmwareVersion);
|
|
92
95
|
};
|
|
93
96
|
const getInfo = ({ features, releases }) => {
|
|
94
|
-
if (!Array.isArray(releases)) {
|
|
97
|
+
if (!Array.isArray(releases) || releases.length < 1) {
|
|
95
98
|
return null;
|
|
96
99
|
}
|
|
97
100
|
if (!(0, firmwareUtils_1.isStrictFeatures)(features)) {
|
|
@@ -130,7 +133,7 @@ const getFirmwareStatus = (features) => {
|
|
|
130
133
|
}
|
|
131
134
|
const info = (0, exports.getInfo)({
|
|
132
135
|
features,
|
|
133
|
-
releases:
|
|
136
|
+
releases: (0, exports.getReleases)(features === null || features === void 0 ? void 0 : features.internal_model),
|
|
134
137
|
});
|
|
135
138
|
if (!info)
|
|
136
139
|
return 'custom';
|
|
@@ -143,9 +146,7 @@ const getFirmwareStatus = (features) => {
|
|
|
143
146
|
exports.getFirmwareStatus = getFirmwareStatus;
|
|
144
147
|
const getRelease = (features) => (0, exports.getInfo)({
|
|
145
148
|
features,
|
|
146
|
-
releases:
|
|
149
|
+
releases: (0, exports.getReleases)(features === null || features === void 0 ? void 0 : features.internal_model),
|
|
147
150
|
});
|
|
148
151
|
exports.getRelease = getRelease;
|
|
149
|
-
const getReleases = (deviceModel) => releases[deviceModel];
|
|
150
|
-
exports.getReleases = getReleases;
|
|
151
152
|
//# sourceMappingURL=firmwareInfo.js.map
|
package/lib/data/models.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.models = void 0;
|
|
4
|
-
const
|
|
4
|
+
const safe3Model = {
|
|
5
5
|
name: 'Trezor Safe 3',
|
|
6
6
|
colors: {
|
|
7
7
|
'1': 'Cosmic Black',
|
|
@@ -20,8 +20,8 @@ exports.models = {
|
|
|
20
20
|
name: 'Trezor Model T',
|
|
21
21
|
colors: {},
|
|
22
22
|
},
|
|
23
|
-
T2B1:
|
|
24
|
-
T3B1:
|
|
23
|
+
T2B1: safe3Model,
|
|
24
|
+
T3B1: safe3Model,
|
|
25
25
|
T3T1: {
|
|
26
26
|
name: 'Trezor Safe 5',
|
|
27
27
|
colors: {
|
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.CONTENT_SCRIPT_VERSION = exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '9.
|
|
4
|
+
exports.VERSION = '9.4.1-beta.1';
|
|
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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Deferred, TypedEmitter } from '@trezor/utils';
|
|
2
|
-
import { Session } from '@trezor/transport';
|
|
3
2
|
import { TransportProtocol } from '@trezor/protocol';
|
|
4
3
|
import { DeviceCommands, PassphrasePromptResponse } from './DeviceCommands';
|
|
5
4
|
import { PROTO, NETWORK } from '../constants';
|
|
6
5
|
import { DEVICE, DeviceButtonRequestPayload } from '../events';
|
|
7
6
|
import { type Transport, type Descriptor } from '@trezor/transport';
|
|
8
|
-
import { Device as DeviceTyped, DeviceFirmwareStatus, Features, ReleaseInfo, UnavailableCapabilities, FirmwareType, VersionArray, KnownDevice } from '../types';
|
|
7
|
+
import { Device as DeviceTyped, DeviceFirmwareStatus, DeviceState, Features, ReleaseInfo, UnavailableCapabilities, FirmwareType, VersionArray, KnownDevice } from '../types';
|
|
8
|
+
import { IStateStorage } from './StateStorage';
|
|
9
9
|
export type RunOptions = {
|
|
10
10
|
skipFinalReload?: boolean;
|
|
11
11
|
waiting?: boolean;
|
|
@@ -23,7 +23,6 @@ export interface DeviceEvents {
|
|
|
23
23
|
[DEVICE.PASSPHRASE_ON_DEVICE]: () => void;
|
|
24
24
|
[DEVICE.BUTTON]: (device: Device, payload: DeviceButtonRequestPayload) => void;
|
|
25
25
|
[DEVICE.ACQUIRED]: () => void;
|
|
26
|
-
[DEVICE.SAVE_STATE]: (state: string) => void;
|
|
27
26
|
}
|
|
28
27
|
export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
29
28
|
transport: Transport;
|
|
@@ -34,18 +33,18 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
34
33
|
firmwareRelease?: ReleaseInfo | null;
|
|
35
34
|
features: Features;
|
|
36
35
|
featuresNeedsReload: boolean;
|
|
37
|
-
acquirePromise
|
|
38
|
-
releasePromise
|
|
39
|
-
runPromise
|
|
36
|
+
private acquirePromise?;
|
|
37
|
+
private releasePromise?;
|
|
38
|
+
private runPromise?;
|
|
39
|
+
private transportSession?;
|
|
40
|
+
keepTransportSession: boolean;
|
|
41
|
+
commands?: DeviceCommands;
|
|
40
42
|
loaded: boolean;
|
|
41
43
|
inconsistent: boolean;
|
|
42
44
|
firstRunPromise: Deferred<boolean>;
|
|
43
|
-
activitySessionID?: Session | null;
|
|
44
|
-
commands?: DeviceCommands;
|
|
45
|
-
keepSession: boolean;
|
|
46
45
|
instance: number;
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
private state;
|
|
47
|
+
private stateStorage?;
|
|
49
48
|
unavailableCapabilities: UnavailableCapabilities;
|
|
50
49
|
networkTypeState: NETWORK.NetworkType[];
|
|
51
50
|
firmwareType?: FirmwareType;
|
|
@@ -53,6 +52,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
53
52
|
color?: string;
|
|
54
53
|
availableTranslations: string[];
|
|
55
54
|
authenticityChecks: NonNullable<KnownDevice['authenticityChecks']>;
|
|
55
|
+
private useCardanoDerivation;
|
|
56
56
|
constructor(transport: Transport, descriptor: Descriptor);
|
|
57
57
|
static fromDescriptor(transport: Transport, originalDescriptor: Descriptor): Device;
|
|
58
58
|
static createUnacquired(transport: Transport, descriptor: Descriptor, unreadableError?: string): Device;
|
|
@@ -67,12 +67,11 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
67
67
|
getCommands(): DeviceCommands;
|
|
68
68
|
setInstance(instance?: number): void;
|
|
69
69
|
getInstance(): number;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
getExternalState(): string;
|
|
74
|
-
validateState(preauthorized?: boolean): Promise<string | undefined>;
|
|
70
|
+
getState(): DeviceState | undefined;
|
|
71
|
+
setState(state?: Partial<DeviceState>): void;
|
|
72
|
+
validateState(preauthorized?: boolean): Promise<`${string}@${string}:${number}` | undefined>;
|
|
75
73
|
initialize(useCardanoDerivation: boolean): Promise<void>;
|
|
74
|
+
initStorage(storage: IStateStorage): void;
|
|
76
75
|
getFeatures(): Promise<void>;
|
|
77
76
|
checkFirmwareRevision(): Promise<void>;
|
|
78
77
|
changeLanguage({ language, binary, }: {
|
|
@@ -92,7 +91,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
92
91
|
isInitialized(): boolean;
|
|
93
92
|
isSeedless(): boolean;
|
|
94
93
|
isInconsistent(): boolean;
|
|
95
|
-
getVersion(): VersionArray |
|
|
94
|
+
getVersion(): VersionArray | undefined;
|
|
96
95
|
atLeast(versions: string[] | string): boolean;
|
|
97
96
|
isUsed(): boolean;
|
|
98
97
|
isUsedHere(): boolean;
|
|
@@ -100,10 +99,44 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
100
99
|
isRunning(): boolean;
|
|
101
100
|
isLoaded(): boolean;
|
|
102
101
|
waitForFirstRun(): Promise<boolean>;
|
|
103
|
-
getDevicePath():
|
|
102
|
+
getDevicePath(): `${number}`;
|
|
104
103
|
isT1(): boolean;
|
|
105
104
|
hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
|
|
106
|
-
|
|
105
|
+
updateDescriptor(descriptor: Descriptor): void;
|
|
106
|
+
dispose(): Promise<{
|
|
107
|
+
success: false;
|
|
108
|
+
error: "Network request failed";
|
|
109
|
+
} | {
|
|
110
|
+
success: false;
|
|
111
|
+
error: "Wrong result type.";
|
|
112
|
+
} | {
|
|
113
|
+
success: false;
|
|
114
|
+
error: "device disconnected during action";
|
|
115
|
+
} | {
|
|
116
|
+
success: false;
|
|
117
|
+
error: "unexpected error";
|
|
118
|
+
} | {
|
|
119
|
+
success: false;
|
|
120
|
+
error: "session not found";
|
|
121
|
+
} | {
|
|
122
|
+
success: false;
|
|
123
|
+
error: "Aborted by timeout";
|
|
124
|
+
} | {
|
|
125
|
+
success: false;
|
|
126
|
+
error: "Aborted by signal";
|
|
127
|
+
} | {
|
|
128
|
+
success: false;
|
|
129
|
+
error: "This transport can not be used in this environment";
|
|
130
|
+
} | {
|
|
131
|
+
success: false;
|
|
132
|
+
error: "device not found";
|
|
133
|
+
} | {
|
|
134
|
+
success: false;
|
|
135
|
+
error: "Unable to open device";
|
|
136
|
+
} | {
|
|
137
|
+
success: false;
|
|
138
|
+
error: "wrong previous session";
|
|
139
|
+
} | import("@trezor/transport/lib/types").Success<void> | undefined>;
|
|
107
140
|
getMode(): "normal" | "bootloader" | "initialize" | "seedless";
|
|
108
141
|
toMessageObject(): DeviceTyped;
|
|
109
142
|
legacyForceRelease(): Promise<void>;
|