@trezor/connect 9.2.3 → 9.2.4-beta.2
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 +77 -5
- package/README.md +1 -1
- package/lib/api/applyFlags.d.ts +8 -1
- package/lib/api/applyFlags.js +3 -8
- package/lib/api/applySettings.d.ts +8 -1
- package/lib/api/applySettings.js +3 -8
- package/lib/api/backupDevice.d.ts +10 -2
- package/lib/api/backupDevice.js +12 -9
- package/lib/api/binance/api/binanceGetAddress.d.ts +4 -3
- package/lib/api/binance/api/binanceGetAddress.js +8 -22
- package/lib/api/binance/api/binanceGetPublicKey.d.ts +4 -2
- package/lib/api/binance/api/binanceGetPublicKey.js +6 -18
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetAddress.d.ts +4 -4
- package/lib/api/cardano/api/cardanoGetAddress.js +9 -39
- package/lib/api/cardano/api/cardanoGetPublicKey.d.ts +4 -3
- package/lib/api/cardano/api/cardanoGetPublicKey.js +9 -31
- package/lib/api/cardano/api/cardanoSignTransaction.d.ts +1 -13
- package/lib/api/cardano/api/cardanoSignTransaction.js +2 -75
- package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -2
- package/lib/api/cardano/cardanoAddressParameters.js +4 -10
- package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -2
- package/lib/api/cardano/cardanoAuxiliaryData.js +2 -2
- package/lib/api/changeLanguage.d.ts +8 -1
- package/lib/api/changeLanguage.js +3 -7
- package/lib/api/eos/api/eosGetPublicKey.d.ts +4 -2
- package/lib/api/eos/api/eosGetPublicKey.js +6 -18
- package/lib/api/ethereum/api/ethereumGetAddress.d.ts +4 -3
- package/lib/api/ethereum/api/ethereumGetAddress.js +4 -20
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +4 -2
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +3 -10
- package/lib/api/firmware/index.d.ts +2 -0
- package/lib/api/firmware/index.js +5 -1
- package/lib/api/firmware/parseFirmwareHeaders.d.ts +5 -0
- package/lib/api/firmware/parseFirmwareHeaders.js +35 -0
- package/lib/api/firmware/uploadFirmware.d.ts +1 -1
- package/lib/api/firmware/uploadFirmware.js +9 -1
- package/lib/api/getAccountDescriptor.d.ts +5 -3
- package/lib/api/getAccountDescriptor.js +8 -21
- package/lib/api/getAccountInfo.d.ts +23 -7
- package/lib/api/getAccountInfo.js +12 -25
- package/lib/api/getAddress.d.ts +4 -3
- package/lib/api/getAddress.js +8 -22
- package/lib/api/getFeatures.d.ts +1 -0
- package/lib/api/getOwnershipId.d.ts +4 -2
- package/lib/api/getOwnershipId.js +4 -15
- package/lib/api/getOwnershipProof.d.ts +4 -2
- package/lib/api/getOwnershipProof.js +4 -15
- package/lib/api/getPublicKey.d.ts +5 -4
- package/lib/api/getPublicKey.js +12 -35
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.js +1 -3
- package/lib/api/nem/api/nemGetAddress.d.ts +4 -3
- package/lib/api/nem/api/nemGetAddress.js +4 -20
- package/lib/api/rebootToBootloader.d.ts +8 -2
- package/lib/api/rebootToBootloader.js +3 -10
- package/lib/api/recoveryDevice.d.ts +8 -1
- package/lib/api/recoveryDevice.js +3 -7
- package/lib/api/resetDevice.d.ts +4 -2
- package/lib/api/resetDevice.js +3 -10
- package/lib/api/ripple/api/rippleGetAddress.d.ts +4 -3
- package/lib/api/ripple/api/rippleGetAddress.js +4 -20
- package/lib/api/solana/api/solanaGetAddress.d.ts +4 -3
- package/lib/api/solana/api/solanaGetAddress.js +7 -28
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +4 -3
- package/lib/api/solana/api/solanaGetPublicKey.js +7 -27
- package/lib/api/stellar/api/stellarGetAddress.d.ts +4 -3
- package/lib/api/stellar/api/stellarGetAddress.js +4 -20
- package/lib/api/tezos/api/tezosGetAddress.d.ts +4 -3
- package/lib/api/tezos/api/tezosGetAddress.js +4 -20
- package/lib/api/tezos/api/tezosGetPublicKey.d.ts +4 -2
- package/lib/api/tezos/api/tezosGetPublicKey.js +6 -18
- package/lib/api/wipeDevice.d.ts +8 -2
- package/lib/api/wipeDevice.js +3 -10
- package/lib/backend/Blockchain.d.ts +2 -2
- package/lib/constants/errors.d.ts +1 -0
- package/lib/constants/errors.js +1 -0
- package/lib/core/AbstractMethod.d.ts +4 -8
- package/lib/core/AbstractMethod.js +6 -28
- package/lib/core/index.d.ts +2 -1
- package/lib/core/index.js +258 -226
- package/lib/core/onCallFirmwareUpdate.d.ts +31 -0
- package/lib/core/onCallFirmwareUpdate.js +266 -0
- package/lib/data/DataManager.d.ts +10 -0
- package/lib/data/analyticsInfo.d.ts +2 -2
- package/lib/data/analyticsInfo.js +6 -7
- package/lib/data/config.d.ts +10 -0
- package/lib/data/config.js +15 -5
- package/lib/data/deviceAuthenticityConfig.js +8 -4
- package/lib/data/firmwareInfo.js +1 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +5 -2
- package/lib/device/Device.d.ts +2 -2
- package/lib/device/Device.js +4 -4
- package/lib/device/DeviceCommands.d.ts +4 -16
- package/lib/device/DeviceCommands.js +10 -72
- package/lib/device/DeviceList.d.ts +7 -4
- package/lib/device/DeviceList.js +46 -40
- package/lib/events/blockchain.d.ts +2 -2
- package/lib/events/index.d.ts +1 -0
- package/lib/events/ui-request.d.ts +13 -1
- package/lib/events/ui-request.js +1 -0
- package/lib/index.js +2 -2
- package/lib/types/api/backupDevice.d.ts +2 -2
- package/lib/types/api/dispose.d.ts +1 -1
- package/lib/types/api/firmwareUpdate.d.ts +7 -6
- package/lib/types/api/firmwareUpdate.js +1 -3
- package/lib/types/index.d.ts +1 -1
- package/lib/types/settings.d.ts +1 -1
- package/lib/utils/popupPromiseManager.d.ts +8 -0
- package/lib/utils/popupPromiseManager.js +21 -0
- package/lib/utils/uiPromiseManager.d.ts +38 -0
- package/lib/utils/uiPromiseManager.js +47 -0
- package/lib/workers/workers-browser.d.ts +3 -1
- package/lib/workers/workers-browser.js +2 -2
- package/package.json +9 -9
- package/lib/api/firmwareUpdate.d.ts +0 -19
- package/lib/api/firmwareUpdate.js +0 -78
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trezor/connect",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.4-beta.2",
|
|
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.",
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"@ethereumjs/common": "^4.2.0",
|
|
71
71
|
"@ethereumjs/tx": "^5.2.1",
|
|
72
72
|
"@fivebinaries/coin-selection": "2.2.1",
|
|
73
|
-
"@trezor/blockchain-link": "2.1.
|
|
74
|
-
"@trezor/blockchain-link-types": "1.0.
|
|
75
|
-
"@trezor/connect-analytics": "1.0.
|
|
76
|
-
"@trezor/connect-common": "0.0.
|
|
77
|
-
"@trezor/protobuf": "1.0.
|
|
78
|
-
"@trezor/protocol": "1.0.
|
|
79
|
-
"@trezor/schema-utils": "1.0.
|
|
80
|
-
"@trezor/transport": "1.1.
|
|
73
|
+
"@trezor/blockchain-link": "2.1.30-beta.2",
|
|
74
|
+
"@trezor/blockchain-link-types": "1.0.17-beta.2",
|
|
75
|
+
"@trezor/connect-analytics": "1.0.15-beta.1",
|
|
76
|
+
"@trezor/connect-common": "0.0.33-beta.1",
|
|
77
|
+
"@trezor/protobuf": "1.0.13-beta.1",
|
|
78
|
+
"@trezor/protocol": "1.0.9-beta.1",
|
|
79
|
+
"@trezor/schema-utils": "1.0.4-beta.1",
|
|
80
|
+
"@trezor/transport": "1.1.29-beta.1",
|
|
81
81
|
"@trezor/utils": "9.0.23",
|
|
82
82
|
"@trezor/utxo-lib": "2.0.9",
|
|
83
83
|
"bignumber.js": "^9.1.2",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
-
import { IntermediaryVersion } from '../types';
|
|
3
|
-
type Params = {
|
|
4
|
-
binary?: ArrayBuffer;
|
|
5
|
-
version?: number[];
|
|
6
|
-
btcOnly?: boolean;
|
|
7
|
-
baseUrl: string;
|
|
8
|
-
intermediaryVersion?: IntermediaryVersion;
|
|
9
|
-
};
|
|
10
|
-
export default class FirmwareUpdate extends AbstractMethod<'firmwareUpdate', Params> {
|
|
11
|
-
init(): void;
|
|
12
|
-
confirmation(): Promise<boolean>;
|
|
13
|
-
run(): Promise<{
|
|
14
|
-
hash: string;
|
|
15
|
-
challenge: string;
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=firmwareUpdate.d.ts.map
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const crypto_1 = require("crypto");
|
|
4
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const events_1 = require("../events");
|
|
7
|
-
const firmware_1 = require("./firmware");
|
|
8
|
-
const firmwareInfo_1 = require("../data/firmwareInfo");
|
|
9
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
|
-
const firmwareUpdate_1 = require("../types/api/firmwareUpdate");
|
|
11
|
-
class FirmwareUpdate extends AbstractMethod_1.AbstractMethod {
|
|
12
|
-
init() {
|
|
13
|
-
this.useEmptyPassphrase = true;
|
|
14
|
-
this.requiredPermissions = ['management'];
|
|
15
|
-
this.allowDeviceMode = [events_1.UI.BOOTLOADER, events_1.UI.INITIALIZE];
|
|
16
|
-
this.requireDeviceMode = [events_1.UI.BOOTLOADER];
|
|
17
|
-
this.useDeviceState = false;
|
|
18
|
-
this.skipFirmwareCheck = true;
|
|
19
|
-
const { payload } = this;
|
|
20
|
-
(0, schema_utils_1.Assert)(firmwareUpdate_1.FirmwareUpdate, payload);
|
|
21
|
-
if (payload.binary) {
|
|
22
|
-
this.params = {
|
|
23
|
-
...this.params,
|
|
24
|
-
binary: payload.binary,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
this.params = {
|
|
29
|
-
version: payload.version,
|
|
30
|
-
btcOnly: payload.btcOnly,
|
|
31
|
-
baseUrl: payload.baseUrl || 'https://data.trezor.io',
|
|
32
|
-
intermediaryVersion: payload.intermediaryVersion,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
async confirmation() {
|
|
37
|
-
await this.getPopupPromise().promise;
|
|
38
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
39
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
40
|
-
view: 'device-management',
|
|
41
|
-
customConfirmButton: {
|
|
42
|
-
className: 'wipe',
|
|
43
|
-
label: 'Proceed',
|
|
44
|
-
},
|
|
45
|
-
label: 'Do you want to update firmware? Never do this without your recovery card.',
|
|
46
|
-
}));
|
|
47
|
-
const uiResp = await uiPromise.promise;
|
|
48
|
-
return uiResp.payload;
|
|
49
|
-
}
|
|
50
|
-
async run() {
|
|
51
|
-
var _a;
|
|
52
|
-
const { device, params } = this;
|
|
53
|
-
let binary;
|
|
54
|
-
try {
|
|
55
|
-
if (params.binary) {
|
|
56
|
-
binary = params.binary;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
binary = await (0, firmware_1.getBinary)({
|
|
60
|
-
features: device.features,
|
|
61
|
-
releases: (0, firmwareInfo_1.getReleases)((_a = device.features) === null || _a === void 0 ? void 0 : _a.internal_model),
|
|
62
|
-
version: params.version,
|
|
63
|
-
btcOnly: params.btcOnly,
|
|
64
|
-
baseUrl: params.baseUrl,
|
|
65
|
-
intermediaryVersion: params.intermediaryVersion,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
catch (err) {
|
|
70
|
-
throw constants_1.ERRORS.TypedError('Method_FirmwareUpdate_DownloadFailed', `Failed to download firmware binary ${err.message}`);
|
|
71
|
-
}
|
|
72
|
-
const stripped = (0, firmware_1.stripFwHeaders)(binary);
|
|
73
|
-
await (0, firmware_1.uploadFirmware)(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, { payload: (0, firmware_1.shouldStripFwHeaders)(device.features) ? stripped : binary });
|
|
74
|
-
return (0, firmware_1.calculateFirmwareHash)(device.features.major_version, stripped, (0, crypto_1.randomBytes)(32));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.default = FirmwareUpdate;
|
|
78
|
-
//# sourceMappingURL=firmwareUpdate.js.map
|