@trezor/connect 9.2.5-beta.2 → 9.3.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 +102 -66
- 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/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 +23 -6
- 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 +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +1 -3
- package/lib/device/Device.js +7 -21
- package/lib/device/DeviceCommands.js +1 -26
- package/lib/events/core.d.ts +2 -2
- 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/package.json +13 -14
- package/lib/core/coreManager.d.ts +0 -16
- package/lib/core/coreManager.js +0 -55
package/lib/types/coinInfo.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare const CoinSupport: import("@sinclair/typebox").TObject<{
|
|
|
27
27
|
T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
28
28
|
T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
29
29
|
T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
30
|
+
T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
30
31
|
T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
31
32
|
connect: import("@sinclair/typebox").TBoolean;
|
|
32
33
|
}>;
|
|
@@ -45,6 +46,7 @@ export declare const BitcoinNetworkInfo: import("@sinclair/typebox").TIntersect<
|
|
|
45
46
|
T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
46
47
|
T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
47
48
|
T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
49
|
+
T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
48
50
|
T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
49
51
|
connect: import("@sinclair/typebox").TBoolean;
|
|
50
52
|
}>;
|
|
@@ -103,6 +105,7 @@ export declare const EthereumNetworkInfo: import("@sinclair/typebox").TIntersect
|
|
|
103
105
|
T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
104
106
|
T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
105
107
|
T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
108
|
+
T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
106
109
|
T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
107
110
|
connect: import("@sinclair/typebox").TBoolean;
|
|
108
111
|
}>;
|
|
@@ -136,6 +139,7 @@ export declare const MiscNetworkInfo: import("@sinclair/typebox").TIntersect<[im
|
|
|
136
139
|
T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
137
140
|
T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
138
141
|
T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
142
|
+
T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
139
143
|
T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
140
144
|
connect: import("@sinclair/typebox").TBoolean;
|
|
141
145
|
}>;
|
|
@@ -169,6 +173,7 @@ export declare const CoinInfo: import("@sinclair/typebox").TUnion<[import("@sinc
|
|
|
169
173
|
T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
170
174
|
T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
171
175
|
T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
176
|
+
T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
172
177
|
T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
173
178
|
connect: import("@sinclair/typebox").TBoolean;
|
|
174
179
|
}>;
|
|
@@ -225,6 +230,7 @@ export declare const CoinInfo: import("@sinclair/typebox").TUnion<[import("@sinc
|
|
|
225
230
|
T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
226
231
|
T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
227
232
|
T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
233
|
+
T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
228
234
|
T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
229
235
|
connect: import("@sinclair/typebox").TBoolean;
|
|
230
236
|
}>;
|
|
@@ -256,6 +262,7 @@ export declare const CoinInfo: import("@sinclair/typebox").TUnion<[import("@sinc
|
|
|
256
262
|
T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
257
263
|
T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
258
264
|
T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
265
|
+
T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
259
266
|
T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
|
|
260
267
|
connect: import("@sinclair/typebox").TBoolean;
|
|
261
268
|
}>;
|
package/lib/types/firmware.d.ts
CHANGED
|
@@ -8,14 +8,14 @@ export type FirmwareRelease = {
|
|
|
8
8
|
required: boolean;
|
|
9
9
|
url: string;
|
|
10
10
|
fingerprint: string;
|
|
11
|
-
changelog: string;
|
|
11
|
+
changelog: string | string[];
|
|
12
|
+
changelog_bitcoinonly?: string | string[];
|
|
12
13
|
version: VersionArray;
|
|
13
14
|
min_firmware_version: VersionArray;
|
|
14
15
|
min_bootloader_version: VersionArray;
|
|
15
16
|
bootloader_version?: VersionArray;
|
|
16
17
|
url_bitcoinonly?: string;
|
|
17
18
|
fingerprint_bitcoinonly?: string;
|
|
18
|
-
notes?: string;
|
|
19
19
|
channel?: string;
|
|
20
20
|
translations?: string[];
|
|
21
21
|
};
|
package/lib/types/settings.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface Manifest {
|
|
|
6
6
|
email: string;
|
|
7
7
|
}
|
|
8
8
|
export type Proxy = BlockchainSettings['proxy'];
|
|
9
|
-
export interface
|
|
9
|
+
export interface ConnectSettingsPublic {
|
|
10
10
|
manifest?: Manifest;
|
|
11
11
|
connectSrc?: string;
|
|
12
12
|
debug?: boolean;
|
|
@@ -19,6 +19,11 @@ export interface ConnectSettings {
|
|
|
19
19
|
pendingTransportEvent?: boolean;
|
|
20
20
|
lazyLoad?: boolean;
|
|
21
21
|
interactionTimeout?: number;
|
|
22
|
+
trustedHost: boolean;
|
|
23
|
+
coreMode?: 'auto' | 'popup' | 'iframe';
|
|
24
|
+
_extendWebextensionLifetime?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ConnectSettingsInternal {
|
|
22
27
|
origin?: string;
|
|
23
28
|
configSrc: string;
|
|
24
29
|
iframeSrc: string;
|
|
@@ -26,13 +31,12 @@ export interface ConnectSettings {
|
|
|
26
31
|
webusbSrc: string;
|
|
27
32
|
version: string;
|
|
28
33
|
priority: number;
|
|
29
|
-
trustedHost: boolean;
|
|
30
34
|
extension?: string;
|
|
31
35
|
env: 'node' | 'web' | 'webextension' | 'electron' | 'react-native';
|
|
32
36
|
timestamp: number;
|
|
33
37
|
proxy?: Proxy;
|
|
34
38
|
sharedLogger?: boolean;
|
|
35
39
|
useCoreInPopup?: boolean;
|
|
36
|
-
_extendWebextensionLifetime?: boolean;
|
|
37
40
|
}
|
|
41
|
+
export type ConnectSettings = ConnectSettingsPublic & ConnectSettingsInternal;
|
|
38
42
|
//# sourceMappingURL=settings.d.ts.map
|
package/lib/utils/assetUtils.js
CHANGED
|
@@ -9,6 +9,7 @@ const firmwareAssets = {
|
|
|
9
9
|
[types_1.DeviceModelInternal.T1B1]: require('@trezor/connect-common/files/firmware/t1b1/releases.json'),
|
|
10
10
|
[types_1.DeviceModelInternal.T2T1]: require('@trezor/connect-common/files/firmware/t2t1/releases.json'),
|
|
11
11
|
[types_1.DeviceModelInternal.T2B1]: require('@trezor/connect-common/files/firmware/t2b1/releases.json'),
|
|
12
|
+
[types_1.DeviceModelInternal.T3B1]: require('@trezor/connect-common/files/firmware/t2b1/releases.json'),
|
|
12
13
|
[types_1.DeviceModelInternal.T3T1]: require('@trezor/connect-common/files/firmware/t3t1/releases.json'),
|
|
13
14
|
};
|
|
14
15
|
const getAssetByUrl = (url) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trezor/connect",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.3.1-beta.1",
|
|
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.",
|
|
@@ -68,19 +68,19 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@babel/preset-typescript": "^7.23.3",
|
|
71
|
-
"@ethereumjs/common": "^4.
|
|
72
|
-
"@ethereumjs/tx": "^5.
|
|
71
|
+
"@ethereumjs/common": "^4.3.0",
|
|
72
|
+
"@ethereumjs/tx": "^5.3.0",
|
|
73
73
|
"@fivebinaries/coin-selection": "2.2.1",
|
|
74
|
-
"@trezor/blockchain-link": "2.1
|
|
75
|
-
"@trezor/blockchain-link-types": "1.
|
|
76
|
-
"@trezor/connect-analytics": "1.0
|
|
77
|
-
"@trezor/connect-common": "0.
|
|
78
|
-
"@trezor/protobuf": "1.
|
|
79
|
-
"@trezor/protocol": "1.0
|
|
80
|
-
"@trezor/schema-utils": "1.0
|
|
81
|
-
"@trezor/transport": "1.1
|
|
82
|
-
"@trezor/utils": "9.
|
|
83
|
-
"@trezor/utxo-lib": "2.0
|
|
74
|
+
"@trezor/blockchain-link": "2.2.1-beta.1",
|
|
75
|
+
"@trezor/blockchain-link-types": "1.1.1-beta.1",
|
|
76
|
+
"@trezor/connect-analytics": "1.1.0",
|
|
77
|
+
"@trezor/connect-common": "0.1.1-beta.1",
|
|
78
|
+
"@trezor/protobuf": "1.1.1-beta.1",
|
|
79
|
+
"@trezor/protocol": "1.1.0",
|
|
80
|
+
"@trezor/schema-utils": "1.1.0",
|
|
81
|
+
"@trezor/transport": "1.2.1-beta.1",
|
|
82
|
+
"@trezor/utils": "9.1.1-beta.1",
|
|
83
|
+
"@trezor/utxo-lib": "2.1.0",
|
|
84
84
|
"blakejs": "^1.2.1",
|
|
85
85
|
"bs58": "^5.0.0",
|
|
86
86
|
"bs58check": "^3.0.1",
|
|
@@ -90,7 +90,6 @@
|
|
|
90
90
|
"@trezor/trezor-user-env-link": "1.0.2",
|
|
91
91
|
"@types/karma": "^6.3.8",
|
|
92
92
|
"babel-loader": "^9.1.3",
|
|
93
|
-
"ethereum-cryptography": "^2.1.3",
|
|
94
93
|
"jest": "29.7.0",
|
|
95
94
|
"karma": "^6.4.2",
|
|
96
95
|
"karma-babel-preprocessor": "^8.0.2",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { CoreEventMessage } from '../events';
|
|
4
|
-
import { ConnectSettings } from '../types';
|
|
5
|
-
type CoreInstance = EventEmitter & {
|
|
6
|
-
init: (settings: ConnectSettings, onCoreEvent: (message: CoreEventMessage) => void, ...rest: any[]) => Promise<void>;
|
|
7
|
-
dispose: () => any;
|
|
8
|
-
};
|
|
9
|
-
export declare const initCoreManager: <Core extends CoreInstance>(core: Core) => {
|
|
10
|
-
getOrInitCore: (...[settings, onCoreEvent, ...rest]: Parameters<Core["init"]>) => Promise<Core>;
|
|
11
|
-
getCore: () => Core | undefined;
|
|
12
|
-
getInitPromise: () => Promise<Core> | undefined;
|
|
13
|
-
dispose: () => void;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=coreManager.d.ts.map
|
package/lib/core/coreManager.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initCoreManager = void 0;
|
|
4
|
-
const utils_1 = require("@trezor/utils");
|
|
5
|
-
const events_1 = require("../events");
|
|
6
|
-
const initCoreManager = (core) => {
|
|
7
|
-
const state = {};
|
|
8
|
-
let initDfd;
|
|
9
|
-
const getOrInitCore = (...[settings, onCoreEvent, ...rest]) => {
|
|
10
|
-
if (state.core)
|
|
11
|
-
return Promise.resolve(state.core);
|
|
12
|
-
if (state.initPromise)
|
|
13
|
-
return state.initPromise;
|
|
14
|
-
const eventThrottle = async (...args) => {
|
|
15
|
-
if (state.initPromise) {
|
|
16
|
-
const core = await state.initPromise.catch(() => { });
|
|
17
|
-
if (!core)
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
onCoreEvent(...args);
|
|
21
|
-
};
|
|
22
|
-
const dfd = (0, utils_1.createDeferred)();
|
|
23
|
-
initDfd = dfd;
|
|
24
|
-
state.initPromise = dfd.promise;
|
|
25
|
-
core.init(settings, eventThrottle, ...rest)
|
|
26
|
-
.then(() => {
|
|
27
|
-
core.on(events_1.CORE_EVENT, onCoreEvent);
|
|
28
|
-
core.off(events_1.CORE_EVENT, eventThrottle);
|
|
29
|
-
state.core = core;
|
|
30
|
-
dfd.resolve(core);
|
|
31
|
-
})
|
|
32
|
-
.catch(dfd.reject)
|
|
33
|
-
.finally(() => {
|
|
34
|
-
initDfd = undefined;
|
|
35
|
-
delete state.initPromise;
|
|
36
|
-
});
|
|
37
|
-
return dfd.promise;
|
|
38
|
-
};
|
|
39
|
-
const dispose = () => {
|
|
40
|
-
var _a;
|
|
41
|
-
initDfd === null || initDfd === void 0 ? void 0 : initDfd.reject(new Error('Core disposed'));
|
|
42
|
-
initDfd = undefined;
|
|
43
|
-
(_a = state.core) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
44
|
-
delete state.initPromise;
|
|
45
|
-
delete state.core;
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
getOrInitCore,
|
|
49
|
-
getCore: () => state.core,
|
|
50
|
-
getInitPromise: () => state.initPromise,
|
|
51
|
-
dispose,
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
exports.initCoreManager = initCoreManager;
|
|
55
|
-
//# sourceMappingURL=coreManager.js.map
|