@trezor/connect 9.1.3 → 9.1.5
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 +36 -0
- package/README.md +3 -1
- package/lib/api/authenticateDevice.d.ts +7 -0
- package/lib/api/authenticateDevice.js +51 -0
- package/lib/api/bitcoin/TransactionComposer.js +1 -9
- package/lib/api/bitcoin/inputs.d.ts +2 -2
- package/lib/api/bitcoin/outputs.d.ts +2 -2
- package/lib/api/cardanoGetPublicKey.d.ts +6 -2
- package/lib/api/cardanoGetPublicKey.js +7 -1
- package/lib/api/checkFirmwareAuthenticity.js +9 -8
- package/lib/api/common/paramsValidator.js +46 -52
- package/lib/api/eos/eosSignTx.js +1 -1
- package/lib/api/ethereum/ethereumDefinitions.js +3 -2
- package/lib/api/firmware/getBinary.js +1 -1
- package/lib/api/firmware/verifyAuthenticityProof.d.ts +14 -0
- package/lib/api/firmware/verifyAuthenticityProof.js +103 -0
- package/lib/api/firmware/x509certificate.d.ts +73 -0
- package/lib/api/firmware/x509certificate.js +203 -0
- package/lib/api/firmwareUpdate.js +4 -4
- package/lib/api/getAccountInfo.d.ts +1 -1
- package/lib/api/getAccountInfo.js +6 -6
- package/lib/api/getFirmwareHash.js +1 -4
- package/lib/api/getPublicKey.d.ts +2 -1
- package/lib/api/getPublicKey.js +7 -1
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +4 -2
- package/lib/api/rebootToBootloader.js +1 -4
- package/lib/api/signTransaction.js +1 -1
- package/lib/core/AbstractMethod.d.ts +5 -4
- package/lib/core/AbstractMethod.js +13 -11
- package/lib/core/index.d.ts +3 -2
- package/lib/core/index.js +23 -12
- package/lib/core/method.d.ts +1 -1
- package/lib/data/DataManager.d.ts +53 -7
- package/lib/data/DataManager.js +4 -2
- package/lib/data/coinInfo.d.ts +5 -5
- package/lib/data/coinInfo.js +1 -1
- package/lib/data/config.d.ts +52 -6
- package/lib/data/config.js +39 -28
- package/lib/data/connectSettings.js +3 -0
- package/lib/data/deviceAuthenticityConfig.d.ts +15 -0
- package/lib/data/deviceAuthenticityConfig.js +26 -0
- package/lib/data/firmwareInfo.d.ts +3 -2
- package/lib/data/firmwareInfo.js +19 -11
- package/lib/data/models.d.ts +21 -0
- package/lib/data/models.js +24 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +5 -3
- package/lib/device/Device.js +37 -22
- package/lib/device/DeviceCommands.js +4 -4
- package/lib/device/DeviceList.d.ts +2 -1
- package/lib/device/DeviceList.js +10 -3
- package/lib/events/iframe.d.ts +7 -1
- package/lib/events/iframe.js +1 -0
- package/lib/events/ui-promise.d.ts +10 -2
- package/lib/factory.js +1 -0
- package/lib/types/api/authenticateDevice.d.ts +21 -0
- package/lib/types/api/authenticateDevice.js +3 -0
- package/lib/types/api/authorizeCoinjoin.d.ts +2 -2
- package/lib/types/api/binance/index.d.ts +2 -1
- package/lib/types/api/bitcoin/index.d.ts +6 -5
- package/lib/types/api/cardano/index.d.ts +12 -12
- package/lib/types/api/cipherKeyValue.d.ts +2 -2
- package/lib/types/api/eos/index.d.ts +3 -2
- package/lib/types/api/ethereum/index.d.ts +5 -4
- package/lib/types/api/getAccountInfo.d.ts +1 -0
- package/lib/types/api/getOwnershipId.d.ts +2 -2
- package/lib/types/api/getOwnershipProof.d.ts +2 -2
- package/lib/types/api/index.d.ts +2 -0
- package/lib/types/api/nem/index.d.ts +2 -1
- package/lib/types/api/ripple/index.d.ts +2 -1
- package/lib/types/api/stellar/index.d.ts +2 -1
- package/lib/types/api/tezos/index.d.ts +3 -2
- package/lib/types/api/unlockPath.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +3 -2
- package/lib/types/device.d.ts +6 -0
- package/lib/types/firmware.d.ts +8 -4
- package/lib/types/index.d.ts +1 -0
- package/lib/types/params.d.ts +14 -2
- package/lib/utils/assetUtils.js +6 -4
- package/lib/utils/debug.d.ts +9 -3
- package/lib/utils/debug.js +50 -17
- package/lib/utils/deviceFeaturesUtils.js +7 -7
- package/lib/utils/pathUtils.d.ts +3 -3
- package/package.json +14 -13
- package/lib/utils/deferred.d.ts +0 -18
- package/lib/utils/deferred.js +0 -66
- package/lib/utils/versionUtils.d.ts +0 -8
- package/lib/utils/versionUtils.js +0 -75
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.versionCompare = exports.versionSplit = exports.normalizeVersionArray = exports.isVersionArray = exports.isValidVersionArray = exports.isValidVersionString = void 0;
|
|
4
|
-
const VER_NUMS = 3;
|
|
5
|
-
const versionRegex = new RegExp(/^[0-9]{1,3}(\.[0-9]{1,3}){0,2}$/);
|
|
6
|
-
const isValidVersionString = (version) => versionRegex.test(version);
|
|
7
|
-
exports.isValidVersionString = isValidVersionString;
|
|
8
|
-
const isValidVersionArray = (version) => {
|
|
9
|
-
if (!Array.isArray(version)) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
if (version.length === 0 || version.length > VER_NUMS) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
if (version[0] === 0) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
for (let i = 0; i < version.length; i++) {
|
|
19
|
-
const versionNumber = version[i];
|
|
20
|
-
if (typeof versionNumber !== 'number' || versionNumber === null || versionNumber < 0) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return true;
|
|
25
|
-
};
|
|
26
|
-
exports.isValidVersionArray = isValidVersionArray;
|
|
27
|
-
const isVersionArray = (arr) => (0, exports.isValidVersionArray)(arr);
|
|
28
|
-
exports.isVersionArray = isVersionArray;
|
|
29
|
-
const normalizeVersionArray = (version) => {
|
|
30
|
-
if (version.length === VER_NUMS) {
|
|
31
|
-
return version;
|
|
32
|
-
}
|
|
33
|
-
const partialVersion = [...version];
|
|
34
|
-
for (let i = version.length; i < VER_NUMS; i++) {
|
|
35
|
-
partialVersion.push(0);
|
|
36
|
-
}
|
|
37
|
-
return partialVersion;
|
|
38
|
-
};
|
|
39
|
-
exports.normalizeVersionArray = normalizeVersionArray;
|
|
40
|
-
const versionSplit = (version) => {
|
|
41
|
-
if (!(0, exports.isValidVersionString)(version)) {
|
|
42
|
-
return [0, 0, 0];
|
|
43
|
-
}
|
|
44
|
-
return version.split('.').map(v => Number(v));
|
|
45
|
-
};
|
|
46
|
-
exports.versionSplit = versionSplit;
|
|
47
|
-
const versionCompare = (a, b) => {
|
|
48
|
-
if (typeof a === 'string' && typeof b === 'string' && a === b) {
|
|
49
|
-
return 0;
|
|
50
|
-
}
|
|
51
|
-
const pa = typeof a === 'string' ? (0, exports.versionSplit)(a) : a;
|
|
52
|
-
const pb = typeof b === 'string' ? (0, exports.versionSplit)(b) : b;
|
|
53
|
-
const vpa = (0, exports.isValidVersionArray)(pa);
|
|
54
|
-
const vpb = (0, exports.isValidVersionArray)(pb);
|
|
55
|
-
if (!vpa && !vpb) {
|
|
56
|
-
return 0;
|
|
57
|
-
}
|
|
58
|
-
if (!vpa && vpb) {
|
|
59
|
-
return -1;
|
|
60
|
-
}
|
|
61
|
-
if (vpa && !vpb) {
|
|
62
|
-
return 1;
|
|
63
|
-
}
|
|
64
|
-
const npa = (0, exports.normalizeVersionArray)(pa);
|
|
65
|
-
const npb = (0, exports.normalizeVersionArray)(pb);
|
|
66
|
-
for (let i = 0; i < VER_NUMS; i++) {
|
|
67
|
-
if (npa[i] > npb[i])
|
|
68
|
-
return 1;
|
|
69
|
-
if (npb[i] > npa[i])
|
|
70
|
-
return -1;
|
|
71
|
-
}
|
|
72
|
-
return 0;
|
|
73
|
-
};
|
|
74
|
-
exports.versionCompare = versionCompare;
|
|
75
|
-
//# sourceMappingURL=versionUtils.js.map
|