@trezor/connect 9.3.0 → 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 +63 -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/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 +9 -10
- package/lib/core/coreManager.d.ts +0 -16
- package/lib/core/coreManager.js +0 -55
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
|