@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
package/lib/api/index.js
CHANGED
|
@@ -1,103 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.unlockPath = exports.signTransaction = exports.signMessage = exports.setProxy = exports.setBusy = exports.setBrightness = exports.resetDevice = exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.getAccountDescriptor = exports.composeTransaction = exports.cipherKeyValue = exports.changeWipeCode = exports.changePin = exports.changeLanguage = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.backupDevice = exports.showDeviceTutorial = exports.cancelCoinjoinAuthorization = exports.authorizeCoinjoin = exports.authenticateDevice = exports.applySettings = exports.applyFlags = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
var applyFlags_1 = require("./applyFlags");
|
|
8
|
-
Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return __importDefault(applyFlags_1).default; } });
|
|
6
|
+
Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return tslib_1.__importDefault(applyFlags_1).default; } });
|
|
9
7
|
var applySettings_1 = require("./applySettings");
|
|
10
|
-
Object.defineProperty(exports, "applySettings", { enumerable: true, get: function () { return __importDefault(applySettings_1).default; } });
|
|
8
|
+
Object.defineProperty(exports, "applySettings", { enumerable: true, get: function () { return tslib_1.__importDefault(applySettings_1).default; } });
|
|
11
9
|
var authenticateDevice_1 = require("./authenticateDevice");
|
|
12
|
-
Object.defineProperty(exports, "authenticateDevice", { enumerable: true, get: function () { return __importDefault(authenticateDevice_1).default; } });
|
|
10
|
+
Object.defineProperty(exports, "authenticateDevice", { enumerable: true, get: function () { return tslib_1.__importDefault(authenticateDevice_1).default; } });
|
|
13
11
|
var authorizeCoinjoin_1 = require("./authorizeCoinjoin");
|
|
14
|
-
Object.defineProperty(exports, "authorizeCoinjoin", { enumerable: true, get: function () { return __importDefault(authorizeCoinjoin_1).default; } });
|
|
12
|
+
Object.defineProperty(exports, "authorizeCoinjoin", { enumerable: true, get: function () { return tslib_1.__importDefault(authorizeCoinjoin_1).default; } });
|
|
15
13
|
var cancelCoinjoinAuthorization_1 = require("./cancelCoinjoinAuthorization");
|
|
16
|
-
Object.defineProperty(exports, "cancelCoinjoinAuthorization", { enumerable: true, get: function () { return __importDefault(cancelCoinjoinAuthorization_1).default; } });
|
|
14
|
+
Object.defineProperty(exports, "cancelCoinjoinAuthorization", { enumerable: true, get: function () { return tslib_1.__importDefault(cancelCoinjoinAuthorization_1).default; } });
|
|
17
15
|
var showDeviceTutorial_1 = require("./showDeviceTutorial");
|
|
18
|
-
Object.defineProperty(exports, "showDeviceTutorial", { enumerable: true, get: function () { return __importDefault(showDeviceTutorial_1).default; } });
|
|
16
|
+
Object.defineProperty(exports, "showDeviceTutorial", { enumerable: true, get: function () { return tslib_1.__importDefault(showDeviceTutorial_1).default; } });
|
|
19
17
|
var backupDevice_1 = require("./backupDevice");
|
|
20
|
-
Object.defineProperty(exports, "backupDevice", { enumerable: true, get: function () { return __importDefault(backupDevice_1).default; } });
|
|
18
|
+
Object.defineProperty(exports, "backupDevice", { enumerable: true, get: function () { return tslib_1.__importDefault(backupDevice_1).default; } });
|
|
21
19
|
var blockchainDisconnect_1 = require("./blockchainDisconnect");
|
|
22
|
-
Object.defineProperty(exports, "blockchainDisconnect", { enumerable: true, get: function () { return __importDefault(blockchainDisconnect_1).default; } });
|
|
20
|
+
Object.defineProperty(exports, "blockchainDisconnect", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainDisconnect_1).default; } });
|
|
23
21
|
var blockchainEstimateFee_1 = require("./blockchainEstimateFee");
|
|
24
|
-
Object.defineProperty(exports, "blockchainEstimateFee", { enumerable: true, get: function () { return __importDefault(blockchainEstimateFee_1).default; } });
|
|
22
|
+
Object.defineProperty(exports, "blockchainEstimateFee", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainEstimateFee_1).default; } });
|
|
25
23
|
var blockchainGetAccountBalanceHistory_1 = require("./blockchainGetAccountBalanceHistory");
|
|
26
|
-
Object.defineProperty(exports, "blockchainGetAccountBalanceHistory", { enumerable: true, get: function () { return __importDefault(blockchainGetAccountBalanceHistory_1).default; } });
|
|
24
|
+
Object.defineProperty(exports, "blockchainGetAccountBalanceHistory", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainGetAccountBalanceHistory_1).default; } });
|
|
27
25
|
var blockchainGetCurrentFiatRates_1 = require("./blockchainGetCurrentFiatRates");
|
|
28
|
-
Object.defineProperty(exports, "blockchainGetCurrentFiatRates", { enumerable: true, get: function () { return __importDefault(blockchainGetCurrentFiatRates_1).default; } });
|
|
26
|
+
Object.defineProperty(exports, "blockchainGetCurrentFiatRates", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainGetCurrentFiatRates_1).default; } });
|
|
29
27
|
var blockchainGetFiatRatesForTimestamps_1 = require("./blockchainGetFiatRatesForTimestamps");
|
|
30
|
-
Object.defineProperty(exports, "blockchainGetFiatRatesForTimestamps", { enumerable: true, get: function () { return __importDefault(blockchainGetFiatRatesForTimestamps_1).default; } });
|
|
28
|
+
Object.defineProperty(exports, "blockchainGetFiatRatesForTimestamps", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainGetFiatRatesForTimestamps_1).default; } });
|
|
31
29
|
var blockchainGetTransactions_1 = require("./blockchainGetTransactions");
|
|
32
|
-
Object.defineProperty(exports, "blockchainGetTransactions", { enumerable: true, get: function () { return __importDefault(blockchainGetTransactions_1).default; } });
|
|
30
|
+
Object.defineProperty(exports, "blockchainGetTransactions", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainGetTransactions_1).default; } });
|
|
33
31
|
var blockchainSetCustomBackend_1 = require("./blockchainSetCustomBackend");
|
|
34
|
-
Object.defineProperty(exports, "blockchainSetCustomBackend", { enumerable: true, get: function () { return __importDefault(blockchainSetCustomBackend_1).default; } });
|
|
32
|
+
Object.defineProperty(exports, "blockchainSetCustomBackend", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainSetCustomBackend_1).default; } });
|
|
35
33
|
var blockchainSubscribe_1 = require("./blockchainSubscribe");
|
|
36
|
-
Object.defineProperty(exports, "blockchainSubscribe", { enumerable: true, get: function () { return __importDefault(blockchainSubscribe_1).default; } });
|
|
34
|
+
Object.defineProperty(exports, "blockchainSubscribe", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainSubscribe_1).default; } });
|
|
37
35
|
var blockchainSubscribeFiatRates_1 = require("./blockchainSubscribeFiatRates");
|
|
38
|
-
Object.defineProperty(exports, "blockchainSubscribeFiatRates", { enumerable: true, get: function () { return __importDefault(blockchainSubscribeFiatRates_1).default; } });
|
|
36
|
+
Object.defineProperty(exports, "blockchainSubscribeFiatRates", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainSubscribeFiatRates_1).default; } });
|
|
39
37
|
var blockchainUnsubscribe_1 = require("./blockchainUnsubscribe");
|
|
40
|
-
Object.defineProperty(exports, "blockchainUnsubscribe", { enumerable: true, get: function () { return __importDefault(blockchainUnsubscribe_1).default; } });
|
|
38
|
+
Object.defineProperty(exports, "blockchainUnsubscribe", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainUnsubscribe_1).default; } });
|
|
41
39
|
var blockchainUnsubscribeFiatRates_1 = require("./blockchainUnsubscribeFiatRates");
|
|
42
|
-
Object.defineProperty(exports, "blockchainUnsubscribeFiatRates", { enumerable: true, get: function () { return __importDefault(blockchainUnsubscribeFiatRates_1).default; } });
|
|
40
|
+
Object.defineProperty(exports, "blockchainUnsubscribeFiatRates", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainUnsubscribeFiatRates_1).default; } });
|
|
43
41
|
var changeLanguage_1 = require("./changeLanguage");
|
|
44
|
-
Object.defineProperty(exports, "changeLanguage", { enumerable: true, get: function () { return __importDefault(changeLanguage_1).default; } });
|
|
42
|
+
Object.defineProperty(exports, "changeLanguage", { enumerable: true, get: function () { return tslib_1.__importDefault(changeLanguage_1).default; } });
|
|
45
43
|
var changePin_1 = require("./changePin");
|
|
46
|
-
Object.defineProperty(exports, "changePin", { enumerable: true, get: function () { return __importDefault(changePin_1).default; } });
|
|
44
|
+
Object.defineProperty(exports, "changePin", { enumerable: true, get: function () { return tslib_1.__importDefault(changePin_1).default; } });
|
|
47
45
|
var changeWipeCode_1 = require("./changeWipeCode");
|
|
48
|
-
Object.defineProperty(exports, "changeWipeCode", { enumerable: true, get: function () { return __importDefault(changeWipeCode_1).default; } });
|
|
46
|
+
Object.defineProperty(exports, "changeWipeCode", { enumerable: true, get: function () { return tslib_1.__importDefault(changeWipeCode_1).default; } });
|
|
49
47
|
var cipherKeyValue_1 = require("./cipherKeyValue");
|
|
50
|
-
Object.defineProperty(exports, "cipherKeyValue", { enumerable: true, get: function () { return __importDefault(cipherKeyValue_1).default; } });
|
|
48
|
+
Object.defineProperty(exports, "cipherKeyValue", { enumerable: true, get: function () { return tslib_1.__importDefault(cipherKeyValue_1).default; } });
|
|
51
49
|
var composeTransaction_1 = require("./composeTransaction");
|
|
52
|
-
Object.defineProperty(exports, "composeTransaction", { enumerable: true, get: function () { return __importDefault(composeTransaction_1).default; } });
|
|
50
|
+
Object.defineProperty(exports, "composeTransaction", { enumerable: true, get: function () { return tslib_1.__importDefault(composeTransaction_1).default; } });
|
|
53
51
|
var getAccountDescriptor_1 = require("./getAccountDescriptor");
|
|
54
|
-
Object.defineProperty(exports, "getAccountDescriptor", { enumerable: true, get: function () { return __importDefault(getAccountDescriptor_1).default; } });
|
|
52
|
+
Object.defineProperty(exports, "getAccountDescriptor", { enumerable: true, get: function () { return tslib_1.__importDefault(getAccountDescriptor_1).default; } });
|
|
55
53
|
var getAccountInfo_1 = require("./getAccountInfo");
|
|
56
|
-
Object.defineProperty(exports, "getAccountInfo", { enumerable: true, get: function () { return __importDefault(getAccountInfo_1).default; } });
|
|
54
|
+
Object.defineProperty(exports, "getAccountInfo", { enumerable: true, get: function () { return tslib_1.__importDefault(getAccountInfo_1).default; } });
|
|
57
55
|
var getAddress_1 = require("./getAddress");
|
|
58
|
-
Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return __importDefault(getAddress_1).default; } });
|
|
56
|
+
Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return tslib_1.__importDefault(getAddress_1).default; } });
|
|
59
57
|
var getCoinInfo_1 = require("./getCoinInfo");
|
|
60
|
-
Object.defineProperty(exports, "getCoinInfo", { enumerable: true, get: function () { return __importDefault(getCoinInfo_1).default; } });
|
|
58
|
+
Object.defineProperty(exports, "getCoinInfo", { enumerable: true, get: function () { return tslib_1.__importDefault(getCoinInfo_1).default; } });
|
|
61
59
|
var getDeviceState_1 = require("./getDeviceState");
|
|
62
|
-
Object.defineProperty(exports, "getDeviceState", { enumerable: true, get: function () { return __importDefault(getDeviceState_1).default; } });
|
|
60
|
+
Object.defineProperty(exports, "getDeviceState", { enumerable: true, get: function () { return tslib_1.__importDefault(getDeviceState_1).default; } });
|
|
63
61
|
var getFeatures_1 = require("./getFeatures");
|
|
64
|
-
Object.defineProperty(exports, "getFeatures", { enumerable: true, get: function () { return __importDefault(getFeatures_1).default; } });
|
|
62
|
+
Object.defineProperty(exports, "getFeatures", { enumerable: true, get: function () { return tslib_1.__importDefault(getFeatures_1).default; } });
|
|
65
63
|
var getFirmwareHash_1 = require("./getFirmwareHash");
|
|
66
|
-
Object.defineProperty(exports, "getFirmwareHash", { enumerable: true, get: function () { return __importDefault(getFirmwareHash_1).default; } });
|
|
64
|
+
Object.defineProperty(exports, "getFirmwareHash", { enumerable: true, get: function () { return tslib_1.__importDefault(getFirmwareHash_1).default; } });
|
|
67
65
|
var getOwnershipId_1 = require("./getOwnershipId");
|
|
68
|
-
Object.defineProperty(exports, "getOwnershipId", { enumerable: true, get: function () { return __importDefault(getOwnershipId_1).default; } });
|
|
66
|
+
Object.defineProperty(exports, "getOwnershipId", { enumerable: true, get: function () { return tslib_1.__importDefault(getOwnershipId_1).default; } });
|
|
69
67
|
var getOwnershipProof_1 = require("./getOwnershipProof");
|
|
70
|
-
Object.defineProperty(exports, "getOwnershipProof", { enumerable: true, get: function () { return __importDefault(getOwnershipProof_1).default; } });
|
|
68
|
+
Object.defineProperty(exports, "getOwnershipProof", { enumerable: true, get: function () { return tslib_1.__importDefault(getOwnershipProof_1).default; } });
|
|
71
69
|
var getPublicKey_1 = require("./getPublicKey");
|
|
72
|
-
Object.defineProperty(exports, "getPublicKey", { enumerable: true, get: function () { return __importDefault(getPublicKey_1).default; } });
|
|
70
|
+
Object.defineProperty(exports, "getPublicKey", { enumerable: true, get: function () { return tslib_1.__importDefault(getPublicKey_1).default; } });
|
|
73
71
|
var getSettings_1 = require("./getSettings");
|
|
74
|
-
Object.defineProperty(exports, "getSettings", { enumerable: true, get: function () { return __importDefault(getSettings_1).default; } });
|
|
72
|
+
Object.defineProperty(exports, "getSettings", { enumerable: true, get: function () { return tslib_1.__importDefault(getSettings_1).default; } });
|
|
75
73
|
var pushTransaction_1 = require("./pushTransaction");
|
|
76
|
-
Object.defineProperty(exports, "pushTransaction", { enumerable: true, get: function () { return __importDefault(pushTransaction_1).default; } });
|
|
74
|
+
Object.defineProperty(exports, "pushTransaction", { enumerable: true, get: function () { return tslib_1.__importDefault(pushTransaction_1).default; } });
|
|
77
75
|
var rebootToBootloader_1 = require("./rebootToBootloader");
|
|
78
|
-
Object.defineProperty(exports, "rebootToBootloader", { enumerable: true, get: function () { return __importDefault(rebootToBootloader_1).default; } });
|
|
76
|
+
Object.defineProperty(exports, "rebootToBootloader", { enumerable: true, get: function () { return tslib_1.__importDefault(rebootToBootloader_1).default; } });
|
|
79
77
|
var recoveryDevice_1 = require("./recoveryDevice");
|
|
80
|
-
Object.defineProperty(exports, "recoveryDevice", { enumerable: true, get: function () { return __importDefault(recoveryDevice_1).default; } });
|
|
78
|
+
Object.defineProperty(exports, "recoveryDevice", { enumerable: true, get: function () { return tslib_1.__importDefault(recoveryDevice_1).default; } });
|
|
81
79
|
var requestLogin_1 = require("./requestLogin");
|
|
82
|
-
Object.defineProperty(exports, "requestLogin", { enumerable: true, get: function () { return __importDefault(requestLogin_1).default; } });
|
|
80
|
+
Object.defineProperty(exports, "requestLogin", { enumerable: true, get: function () { return tslib_1.__importDefault(requestLogin_1).default; } });
|
|
83
81
|
var resetDevice_1 = require("./resetDevice");
|
|
84
|
-
Object.defineProperty(exports, "resetDevice", { enumerable: true, get: function () { return __importDefault(resetDevice_1).default; } });
|
|
82
|
+
Object.defineProperty(exports, "resetDevice", { enumerable: true, get: function () { return tslib_1.__importDefault(resetDevice_1).default; } });
|
|
85
83
|
var setBrightness_1 = require("./setBrightness");
|
|
86
|
-
Object.defineProperty(exports, "setBrightness", { enumerable: true, get: function () { return __importDefault(setBrightness_1).default; } });
|
|
84
|
+
Object.defineProperty(exports, "setBrightness", { enumerable: true, get: function () { return tslib_1.__importDefault(setBrightness_1).default; } });
|
|
87
85
|
var setBusy_1 = require("./setBusy");
|
|
88
|
-
Object.defineProperty(exports, "setBusy", { enumerable: true, get: function () { return __importDefault(setBusy_1).default; } });
|
|
86
|
+
Object.defineProperty(exports, "setBusy", { enumerable: true, get: function () { return tslib_1.__importDefault(setBusy_1).default; } });
|
|
89
87
|
var setProxy_1 = require("./setProxy");
|
|
90
|
-
Object.defineProperty(exports, "setProxy", { enumerable: true, get: function () { return __importDefault(setProxy_1).default; } });
|
|
88
|
+
Object.defineProperty(exports, "setProxy", { enumerable: true, get: function () { return tslib_1.__importDefault(setProxy_1).default; } });
|
|
91
89
|
var signMessage_1 = require("./signMessage");
|
|
92
|
-
Object.defineProperty(exports, "signMessage", { enumerable: true, get: function () { return __importDefault(signMessage_1).default; } });
|
|
90
|
+
Object.defineProperty(exports, "signMessage", { enumerable: true, get: function () { return tslib_1.__importDefault(signMessage_1).default; } });
|
|
93
91
|
var signTransaction_1 = require("./signTransaction");
|
|
94
|
-
Object.defineProperty(exports, "signTransaction", { enumerable: true, get: function () { return __importDefault(signTransaction_1).default; } });
|
|
92
|
+
Object.defineProperty(exports, "signTransaction", { enumerable: true, get: function () { return tslib_1.__importDefault(signTransaction_1).default; } });
|
|
95
93
|
var unlockPath_1 = require("./unlockPath");
|
|
96
|
-
Object.defineProperty(exports, "unlockPath", { enumerable: true, get: function () { return __importDefault(unlockPath_1).default; } });
|
|
94
|
+
Object.defineProperty(exports, "unlockPath", { enumerable: true, get: function () { return tslib_1.__importDefault(unlockPath_1).default; } });
|
|
97
95
|
var verifyMessage_1 = require("./verifyMessage");
|
|
98
|
-
Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return __importDefault(verifyMessage_1).default; } });
|
|
96
|
+
Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return tslib_1.__importDefault(verifyMessage_1).default; } });
|
|
99
97
|
var wipeDevice_1 = require("./wipeDevice");
|
|
100
|
-
Object.defineProperty(exports, "wipeDevice", { enumerable: true, get: function () { return __importDefault(wipeDevice_1).default; } });
|
|
98
|
+
Object.defineProperty(exports, "wipeDevice", { enumerable: true, get: function () { return tslib_1.__importDefault(wipeDevice_1).default; } });
|
|
101
99
|
var checkFirmwareAuthenticity_1 = require("./checkFirmwareAuthenticity");
|
|
102
|
-
Object.defineProperty(exports, "checkFirmwareAuthenticity", { enumerable: true, get: function () { return __importDefault(checkFirmwareAuthenticity_1).default; } });
|
|
100
|
+
Object.defineProperty(exports, "checkFirmwareAuthenticity", { enumerable: true, get: function () { return tslib_1.__importDefault(checkFirmwareAuthenticity_1).default; } });
|
|
103
101
|
//# sourceMappingURL=index.js.map
|
package/lib/api/nem/api/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.nemSignTransaction = exports.nemGetAddress = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
var nemGetAddress_1 = require("./nemGetAddress");
|
|
8
|
-
Object.defineProperty(exports, "nemGetAddress", { enumerable: true, get: function () { return __importDefault(nemGetAddress_1).default; } });
|
|
6
|
+
Object.defineProperty(exports, "nemGetAddress", { enumerable: true, get: function () { return tslib_1.__importDefault(nemGetAddress_1).default; } });
|
|
9
7
|
var nemSignTransaction_1 = require("./nemSignTransaction");
|
|
10
|
-
Object.defineProperty(exports, "nemSignTransaction", { enumerable: true, get: function () { return __importDefault(nemSignTransaction_1).default; } });
|
|
8
|
+
Object.defineProperty(exports, "nemSignTransaction", { enumerable: true, get: function () { return tslib_1.__importDefault(nemSignTransaction_1).default; } });
|
|
11
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -8,7 +8,7 @@ const schema_utils_1 = require("@trezor/schema-utils");
|
|
|
8
8
|
const pushTransaction_1 = require("../types/api/pushTransaction");
|
|
9
9
|
class PushTransaction extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
init() {
|
|
11
|
-
this.requiredPermissions = [];
|
|
11
|
+
this.requiredPermissions = ['push_tx'];
|
|
12
12
|
this.useUi = false;
|
|
13
13
|
this.useDevice = false;
|
|
14
14
|
const { payload } = this;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.rippleSignTransaction = exports.rippleGetAddress = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
var rippleGetAddress_1 = require("./rippleGetAddress");
|
|
8
|
-
Object.defineProperty(exports, "rippleGetAddress", { enumerable: true, get: function () { return __importDefault(rippleGetAddress_1).default; } });
|
|
6
|
+
Object.defineProperty(exports, "rippleGetAddress", { enumerable: true, get: function () { return tslib_1.__importDefault(rippleGetAddress_1).default; } });
|
|
9
7
|
var rippleSignTransaction_1 = require("./rippleSignTransaction");
|
|
10
|
-
Object.defineProperty(exports, "rippleSignTransaction", { enumerable: true, get: function () { return __importDefault(rippleSignTransaction_1).default; } });
|
|
8
|
+
Object.defineProperty(exports, "rippleSignTransaction", { enumerable: true, get: function () { return tslib_1.__importDefault(rippleSignTransaction_1).default; } });
|
|
11
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -95,6 +95,9 @@ class SignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
95
95
|
unlockPath: payload.unlockPath,
|
|
96
96
|
};
|
|
97
97
|
this.params.options = (0, bitcoin_1.enhanceSignTx)(this.params.options, coinInfo);
|
|
98
|
+
if (this.params.push) {
|
|
99
|
+
this.requiredPermissions.push('push_tx');
|
|
100
|
+
}
|
|
98
101
|
}
|
|
99
102
|
get info() {
|
|
100
103
|
const coinInfo = (0, coinInfo_1.getBitcoinNetwork)(this.payload.coin);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.solanaSignTransaction = exports.solanaGetPublicKey = exports.solanaGetAddress = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
var solanaGetAddress_1 = require("./solanaGetAddress");
|
|
8
|
-
Object.defineProperty(exports, "solanaGetAddress", { enumerable: true, get: function () { return __importDefault(solanaGetAddress_1).default; } });
|
|
6
|
+
Object.defineProperty(exports, "solanaGetAddress", { enumerable: true, get: function () { return tslib_1.__importDefault(solanaGetAddress_1).default; } });
|
|
9
7
|
var solanaGetPublicKey_1 = require("./solanaGetPublicKey");
|
|
10
|
-
Object.defineProperty(exports, "solanaGetPublicKey", { enumerable: true, get: function () { return __importDefault(solanaGetPublicKey_1).default; } });
|
|
8
|
+
Object.defineProperty(exports, "solanaGetPublicKey", { enumerable: true, get: function () { return tslib_1.__importDefault(solanaGetPublicKey_1).default; } });
|
|
11
9
|
var solanaSignTransaction_1 = require("./solanaSignTransaction");
|
|
12
|
-
Object.defineProperty(exports, "solanaSignTransaction", { enumerable: true, get: function () { return __importDefault(solanaSignTransaction_1).default; } });
|
|
10
|
+
Object.defineProperty(exports, "solanaSignTransaction", { enumerable: true, get: function () { return tslib_1.__importDefault(solanaSignTransaction_1).default; } });
|
|
13
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.stellarSignTransaction = exports.stellarGetAddress = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
var stellarGetAddress_1 = require("./stellarGetAddress");
|
|
8
|
-
Object.defineProperty(exports, "stellarGetAddress", { enumerable: true, get: function () { return __importDefault(stellarGetAddress_1).default; } });
|
|
6
|
+
Object.defineProperty(exports, "stellarGetAddress", { enumerable: true, get: function () { return tslib_1.__importDefault(stellarGetAddress_1).default; } });
|
|
9
7
|
var stellarSignTransaction_1 = require("./stellarSignTransaction");
|
|
10
|
-
Object.defineProperty(exports, "stellarSignTransaction", { enumerable: true, get: function () { return __importDefault(stellarSignTransaction_1).default; } });
|
|
8
|
+
Object.defineProperty(exports, "stellarSignTransaction", { enumerable: true, get: function () { return tslib_1.__importDefault(stellarSignTransaction_1).default; } });
|
|
11
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
var tezosGetAddress_1 = require("./tezosGetAddress");
|
|
8
|
-
Object.defineProperty(exports, "tezosGetAddress", { enumerable: true, get: function () { return __importDefault(tezosGetAddress_1).default; } });
|
|
6
|
+
Object.defineProperty(exports, "tezosGetAddress", { enumerable: true, get: function () { return tslib_1.__importDefault(tezosGetAddress_1).default; } });
|
|
9
7
|
var tezosGetPublicKey_1 = require("./tezosGetPublicKey");
|
|
10
|
-
Object.defineProperty(exports, "tezosGetPublicKey", { enumerable: true, get: function () { return __importDefault(tezosGetPublicKey_1).default; } });
|
|
8
|
+
Object.defineProperty(exports, "tezosGetPublicKey", { enumerable: true, get: function () { return tslib_1.__importDefault(tezosGetPublicKey_1).default; } });
|
|
11
9
|
var tezosSignTransaction_1 = require("./tezosSignTransaction");
|
|
12
|
-
Object.defineProperty(exports, "tezosSignTransaction", { enumerable: true, get: function () { return __importDefault(tezosSignTransaction_1).default; } });
|
|
10
|
+
Object.defineProperty(exports, "tezosSignTransaction", { enumerable: true, get: function () { return tslib_1.__importDefault(tezosSignTransaction_1).default; } });
|
|
13
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createTx = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const bs58check_1 = tslib_1.__importDefault(require("bs58check"));
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
7
7
|
const tezos_1 = require("../../types/api/tezos");
|
|
8
8
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
@@ -16,7 +16,7 @@ const PREFIX = {
|
|
|
16
16
|
sppk: new Uint8Array([3, 254, 226, 86]),
|
|
17
17
|
p2pk: new Uint8Array([3, 178, 139, 127]),
|
|
18
18
|
};
|
|
19
|
-
const bs58checkDecode = (prefix, enc) =>
|
|
19
|
+
const bs58checkDecode = (prefix, enc) => bs58check_1.default.decode(enc).slice(prefix.length);
|
|
20
20
|
const concatArray = (first, second) => {
|
|
21
21
|
const result = new Uint8Array(first.length + second.length);
|
|
22
22
|
result.set(first);
|
|
@@ -49,8 +49,8 @@ export declare class Blockchain {
|
|
|
49
49
|
getAccountUtxo(descriptor: string): Promise<import("@trezor/blockchain-link").Utxo[]>;
|
|
50
50
|
estimateFee(request: Parameters<typeof this.link.estimateFee>[0]): Promise<{
|
|
51
51
|
feePerUnit: string;
|
|
52
|
-
feePerTx?: string
|
|
53
|
-
feeLimit?: string
|
|
52
|
+
feePerTx?: string;
|
|
53
|
+
feeLimit?: string;
|
|
54
54
|
}[]>;
|
|
55
55
|
subscribeBlocks(): Promise<{
|
|
56
56
|
subscribed: boolean;
|
|
@@ -2,9 +2,9 @@ import type { BlockchainOptions as Options } from './Blockchain';
|
|
|
2
2
|
import type { CoinInfo } from '../types';
|
|
3
3
|
export { Blockchain } from './Blockchain';
|
|
4
4
|
export declare const findBackend: (coin: string, identity?: string) => import("./Blockchain").Blockchain | null;
|
|
5
|
-
export declare const setCustomBackend: (coinInfo: CoinInfo, blockchainLink: CoinInfo[
|
|
5
|
+
export declare const setCustomBackend: (coinInfo: CoinInfo, blockchainLink: CoinInfo["blockchainLink"]) => void;
|
|
6
6
|
export declare const isBackendSupported: (coinInfo: CoinInfo) => void;
|
|
7
|
-
export declare const initBlockchain: (coinInfo: CoinInfo, postMessage: Options[
|
|
7
|
+
export declare const initBlockchain: (coinInfo: CoinInfo, postMessage: Options["postMessage"], identity?: string) => Promise<import("./Blockchain").Blockchain>;
|
|
8
8
|
export declare const reconnectAllBackends: (coinInfo?: CoinInfo) => Promise<import("./Blockchain").Blockchain[]>;
|
|
9
9
|
export declare const dispose: () => void;
|
|
10
10
|
//# sourceMappingURL=BlockchainLink.d.ts.map
|
package/lib/constants/nem.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare enum Networks {
|
|
|
5
5
|
mijin = 96
|
|
6
6
|
}
|
|
7
7
|
export type EnumNetworks = Static<typeof EnumNetworks>;
|
|
8
|
-
export declare const EnumNetworks: import("@sinclair/typebox").TEnum<typeof Networks>;
|
|
8
|
+
export declare const EnumNetworks: import("@sinclair/typebox/build/esm/index.mjs").TEnum<typeof Networks>;
|
|
9
9
|
export declare enum TxType {
|
|
10
10
|
TRANSFER = 257,
|
|
11
11
|
COSIGNING = 258,
|
|
@@ -18,12 +18,12 @@ export declare enum TxType {
|
|
|
18
18
|
SUPPLY_CHANGE = 16386
|
|
19
19
|
}
|
|
20
20
|
export type EnumTxType = Static<typeof EnumTxType>;
|
|
21
|
-
export declare const EnumTxType: import("@sinclair/typebox").TEnum<typeof TxType>;
|
|
21
|
+
export declare const EnumTxType: import("@sinclair/typebox/build/esm/index.mjs").TEnum<typeof TxType>;
|
|
22
22
|
export declare enum TxVersion {
|
|
23
23
|
mainnet = 1744830464,
|
|
24
24
|
testnet = -1744830464,
|
|
25
25
|
mijin = 1610612736
|
|
26
26
|
}
|
|
27
27
|
export type EnumTxVersion = Static<typeof EnumTxVersion>;
|
|
28
|
-
export declare const EnumTxVersion: import("@sinclair/typebox").TEnum<typeof TxVersion>;
|
|
28
|
+
export declare const EnumTxVersion: import("@sinclair/typebox/build/esm/index.mjs").TEnum<typeof TxVersion>;
|
|
29
29
|
//# sourceMappingURL=nem.d.ts.map
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { NETWORK } from '../constants';
|
|
2
|
-
import { CallMethodPayload, CallMethodResponse, UiRequestButtonData, UiPromiseCreator, CoreEventMessage, UiRequestConfirmation } from '../events';
|
|
2
|
+
import { UI, CallMethodPayload, CallMethodResponse, UiRequestButtonData, UiPromiseCreator, CoreEventMessage, UiRequestConfirmation } from '../events';
|
|
3
3
|
import type { Device } from '../device/Device';
|
|
4
|
-
import type { FirmwareRange } from '../types';
|
|
4
|
+
import type { FirmwareRange, DeviceState } from '../types';
|
|
5
5
|
export type Payload<M> = Extract<CallMethodPayload, {
|
|
6
6
|
method: M;
|
|
7
7
|
}> & {
|
|
8
8
|
override?: boolean;
|
|
9
9
|
};
|
|
10
10
|
export type MethodReturnType<M extends CallMethodPayload['method']> = CallMethodResponse<M>;
|
|
11
|
+
export type MethodPermission = 'read' | 'write' | 'management' | 'push_tx';
|
|
12
|
+
export type DeviceMode = typeof UI.SEEDLESS | typeof UI.BOOTLOADER | typeof UI.INITIALIZE;
|
|
11
13
|
export declare const DEFAULT_FIRMWARE_RANGE: FirmwareRange;
|
|
12
14
|
export declare abstract class AbstractMethod<Name extends CallMethodPayload['method'], Params = undefined> {
|
|
13
15
|
responseID: number;
|
|
14
16
|
device: Device;
|
|
15
17
|
params: Params;
|
|
16
18
|
devicePath?: string;
|
|
17
|
-
deviceState?:
|
|
19
|
+
deviceState?: DeviceState;
|
|
18
20
|
hasExpectedDeviceState: boolean;
|
|
19
21
|
keepSession: boolean;
|
|
20
22
|
skipFinalReload: boolean;
|
|
@@ -32,9 +34,9 @@ export declare abstract class AbstractMethod<Name extends CallMethodPayload['met
|
|
|
32
34
|
useEmptyPassphrase: boolean;
|
|
33
35
|
allowSeedlessDevice: boolean;
|
|
34
36
|
firmwareRange: FirmwareRange;
|
|
35
|
-
requiredPermissions:
|
|
36
|
-
allowDeviceMode:
|
|
37
|
-
requireDeviceMode:
|
|
37
|
+
requiredPermissions: MethodPermission[];
|
|
38
|
+
allowDeviceMode: DeviceMode[];
|
|
39
|
+
requireDeviceMode: DeviceMode[];
|
|
38
40
|
network: NETWORK.NetworkType;
|
|
39
41
|
useCardanoDerivation: boolean;
|
|
40
42
|
noBackupConfirmationMode: 'never' | 'always' | 'popup-only';
|
|
@@ -7,6 +7,7 @@ const DataManager_1 = require("../data/DataManager");
|
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
const events_1 = require("../events");
|
|
9
9
|
const urlUtils_1 = require("../utils/urlUtils");
|
|
10
|
+
const constants_2 = require("../constants");
|
|
10
11
|
exports.DEFAULT_FIRMWARE_RANGE = {
|
|
11
12
|
T1B1: { min: '1.0.0', max: '0' },
|
|
12
13
|
T2T1: { min: '2.0.0', max: '0' },
|
|
@@ -14,6 +15,19 @@ exports.DEFAULT_FIRMWARE_RANGE = {
|
|
|
14
15
|
T3B1: { min: '2.8.1', max: '0' },
|
|
15
16
|
T3T1: { min: '2.7.1', max: '0' },
|
|
16
17
|
};
|
|
18
|
+
function validateStaticSessionId(input) {
|
|
19
|
+
if (typeof input !== 'string')
|
|
20
|
+
throw constants_2.ERRORS.TypedError('Method_InvalidParameter', 'DeviceState: invalid staticSessionId: ' + input);
|
|
21
|
+
const [firstTestnetAddress, rest] = input.split('@');
|
|
22
|
+
const [deviceId, instance] = rest.split(':');
|
|
23
|
+
if (typeof firstTestnetAddress === 'string' &&
|
|
24
|
+
typeof deviceId === 'string' &&
|
|
25
|
+
typeof instance === 'string' &&
|
|
26
|
+
Number.parseInt(instance) >= 0) {
|
|
27
|
+
return input;
|
|
28
|
+
}
|
|
29
|
+
throw constants_2.ERRORS.TypedError('Method_InvalidParameter', 'DeviceState: invalid staticSessionId: ' + input);
|
|
30
|
+
}
|
|
17
31
|
class AbstractMethod {
|
|
18
32
|
get info() {
|
|
19
33
|
return '';
|
|
@@ -22,13 +36,20 @@ class AbstractMethod {
|
|
|
22
36
|
return undefined;
|
|
23
37
|
}
|
|
24
38
|
constructor(message) {
|
|
25
|
-
var _a, _b;
|
|
39
|
+
var _a, _b, _c, _d;
|
|
26
40
|
const { payload } = message;
|
|
27
41
|
this.name = payload.method;
|
|
28
42
|
this.payload = payload;
|
|
29
43
|
this.responseID = message.id || 0;
|
|
30
44
|
this.devicePath = (_a = payload.device) === null || _a === void 0 ? void 0 : _a.path;
|
|
31
|
-
this.deviceState =
|
|
45
|
+
this.deviceState =
|
|
46
|
+
typeof ((_b = payload.device) === null || _b === void 0 ? void 0 : _b.state) === 'string'
|
|
47
|
+
? { staticSessionId: validateStaticSessionId(payload.device.state) }
|
|
48
|
+
: ((_d = (_c = payload.device) === null || _c === void 0 ? void 0 : _c.state) === null || _d === void 0 ? void 0 : _d.staticSessionId)
|
|
49
|
+
? {
|
|
50
|
+
staticSessionId: validateStaticSessionId(payload.device.state.staticSessionId),
|
|
51
|
+
}
|
|
52
|
+
: undefined;
|
|
32
53
|
this.hasExpectedDeviceState = payload.device
|
|
33
54
|
? Object.prototype.hasOwnProperty.call(payload.device, 'state')
|
|
34
55
|
: false;
|
|
@@ -135,7 +156,9 @@ class AbstractMethod {
|
|
|
135
156
|
if (range.min === '0') {
|
|
136
157
|
return events_1.UI.FIRMWARE_NOT_SUPPORTED;
|
|
137
158
|
}
|
|
138
|
-
const version = device.getVersion()
|
|
159
|
+
const version = device.getVersion();
|
|
160
|
+
if (!version)
|
|
161
|
+
return;
|
|
139
162
|
if (device.firmwareStatus === 'required' ||
|
|
140
163
|
!utils_1.versionUtils.isNewerOrEqual(version, range.min)) {
|
|
141
164
|
return events_1.UI.FIRMWARE_OLD;
|
package/lib/core/index.d.ts
CHANGED