@trezor/connect 9.0.0 → 9.0.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/README.md +7 -7
- package/lib/api/checkFirmwareAuthenticity.d.ts +10 -0
- package/lib/api/checkFirmwareAuthenticity.js +44 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +3 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/method.d.ts +1 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +1 -0
- package/lib/device/Device.js +8 -0
- package/lib/factory.js +1 -0
- package/lib/types/api/checkFirmwareAuthenticity.d.ts +8 -0
- package/lib/types/api/checkFirmwareAuthenticity.js +3 -0
- package/lib/types/api/index.d.ts +2 -0
- package/lib/types/device.d.ts +4 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @trezor/connect
|
|
2
2
|
|
|
3
|
-
API version 9.0.
|
|
3
|
+
API version 9.0.1
|
|
4
4
|
|
|
5
5
|
[](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
|
|
6
6
|
[](https://www.npmjs.org/package/@trezor/connect)
|
|
@@ -34,18 +34,18 @@ import TrezorConnect from '@trezor/connect';
|
|
|
34
34
|
|
|
35
35
|
For more instructions [refer to this document](../../docs/packages/connect/index.md)
|
|
36
36
|
|
|
37
|
-
## Version 9
|
|
37
|
+
## Version 9 (stable)
|
|
38
38
|
|
|
39
39
|
Since version 9 we are adopting a new versioning strategy. With every release, we are going to update two urls
|
|
40
40
|
|
|
41
|
-
- A
|
|
42
|
-
- B
|
|
41
|
+
- A) The latest release will always be available on https://connect.trezor.io/9/trezor-connect.js.
|
|
42
|
+
- B) For those who like to have more control over their dependencies, there will be also a new url created in form of https://connect.trezor.io/9.1../trezor-connect.js. Please note that these endpoints will not receive any further updates including security updates.
|
|
43
43
|
|
|
44
|
-
Version 9
|
|
44
|
+
Version 9 is available as `@trezor/connect` and `@trezor/connect-web` npm packages.
|
|
45
45
|
|
|
46
|
-
## Version 8 (
|
|
46
|
+
## Version 8 (legacy)
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Legacy version 8 is accessible from url https://connect.trezor.io/8/trezor-connect.js.
|
|
49
49
|
|
|
50
50
|
Version 8 is available as `trezor-connect` npm package.
|
|
51
51
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
export default class CheckFirmwareAuthenticity extends AbstractMethod<'checkFirmwareAuthenticity'> {
|
|
3
|
+
init(): void;
|
|
4
|
+
run(): Promise<{
|
|
5
|
+
expectedFirmwareHash: string;
|
|
6
|
+
actualFirmwareHash: string;
|
|
7
|
+
valid: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=checkFirmwareAuthenticity.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const randombytes_1 = tslib_1.__importDefault(require("randombytes"));
|
|
5
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
6
|
+
const firmware_1 = require("./firmware");
|
|
7
|
+
const firmwareInfo_1 = require("../data/firmwareInfo");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
const assets_1 = require("../utils/assets");
|
|
10
|
+
class CheckFirmwareAuthenticity extends AbstractMethod_1.AbstractMethod {
|
|
11
|
+
init() {
|
|
12
|
+
this.useEmptyPassphrase = true;
|
|
13
|
+
this.requiredPermissions = ['management'];
|
|
14
|
+
this.useDeviceState = false;
|
|
15
|
+
}
|
|
16
|
+
async run() {
|
|
17
|
+
const { device } = this;
|
|
18
|
+
const deviceVersion = `${device.features.major_version}.${device.features.minor_version}.${device.features.patch_version}`;
|
|
19
|
+
const releases = (0, firmwareInfo_1.getReleases)(device.features.major_version);
|
|
20
|
+
const release = releases.find(release => release.version.join('.') === deviceVersion);
|
|
21
|
+
if (!release) {
|
|
22
|
+
throw constants_1.ERRORS.TypedError('Runtime', 'checkFirmwareAuthenticity: No release found for device firmware');
|
|
23
|
+
}
|
|
24
|
+
const baseUrl = `https://data.trezor.io/firmware/${device.features.major_version}`;
|
|
25
|
+
const fwUrl = `${baseUrl}/trezor-${deviceVersion}${device.firmwareType === 'bitcoin-only' ? '-bitcoinonly.bin' : '.bin'}`;
|
|
26
|
+
const fw = await (0, assets_1.httpRequest)(fwUrl, 'binary');
|
|
27
|
+
if (!fw) {
|
|
28
|
+
throw constants_1.ERRORS.TypedError('Runtime', 'checkFirmwareAuthenticity: firmware binary not found');
|
|
29
|
+
}
|
|
30
|
+
const { hash: expectedFirmwareHash, challenge } = (0, firmware_1.calculateFirmwareHash)(device.features.major_version, (0, firmware_1.stripFwHeaders)(fw), (0, randombytes_1.default)(32));
|
|
31
|
+
const result = await this.device.commands.typedCall('GetFirmwareHash', 'FirmwareHash', {
|
|
32
|
+
challenge,
|
|
33
|
+
});
|
|
34
|
+
const { message } = result;
|
|
35
|
+
const { hash: actualFirmwareHash } = message;
|
|
36
|
+
return {
|
|
37
|
+
expectedFirmwareHash,
|
|
38
|
+
actualFirmwareHash,
|
|
39
|
+
valid: actualFirmwareHash === expectedFirmwareHash,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = CheckFirmwareAuthenticity;
|
|
44
|
+
//# sourceMappingURL=checkFirmwareAuthenticity.js.map
|
package/lib/api/index.d.ts
CHANGED
|
@@ -61,4 +61,5 @@ export { default as tezosGetPublicKey } from './tezosGetPublicKey';
|
|
|
61
61
|
export { default as tezosSignTransaction } from './tezosSignTransaction';
|
|
62
62
|
export { default as verifyMessage } from './verifyMessage';
|
|
63
63
|
export { default as wipeDevice } from './wipeDevice';
|
|
64
|
+
export { default as checkFirmwareAuthenticity } from './checkFirmwareAuthenticity';
|
|
64
65
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/api/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.nemSignTransaction = exports.nemGetAddress = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.firmwareUpdate = exports.ethereumVerifyMessage = exports.ethereumSignTypedData = exports.ethereumSignTransaction = exports.ethereumSignMessage = exports.ethereumGetPublicKey = exports.ethereumGetAddress = exports.eosSignTransaction = exports.eosGetPublicKey = exports.composeTransaction = exports.cipherKeyValue = exports.changePin = exports.cardanoSignTransaction = exports.cardanoGetPublicKey = exports.cardanoGetNativeScriptHash = exports.cardanoGetAddress = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.binanceSignTransaction = exports.binanceGetPublicKey = exports.binanceGetAddress = exports.backupDevice = exports.authorizeCoinJoin = exports.applySettings = exports.applyFlags = void 0;
|
|
7
|
-
exports.wipeDevice = exports.verifyMessage = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.rippleSignTransaction = exports.rippleGetAddress = exports.resetDevice = void 0;
|
|
7
|
+
exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.rippleSignTransaction = exports.rippleGetAddress = exports.resetDevice = void 0;
|
|
8
8
|
var applyFlags_1 = require("./applyFlags");
|
|
9
9
|
Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return __importDefault(applyFlags_1).default; } });
|
|
10
10
|
var applySettings_1 = require("./applySettings");
|
|
@@ -131,4 +131,6 @@ var verifyMessage_1 = require("./verifyMessage");
|
|
|
131
131
|
Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return __importDefault(verifyMessage_1).default; } });
|
|
132
132
|
var wipeDevice_1 = require("./wipeDevice");
|
|
133
133
|
Object.defineProperty(exports, "wipeDevice", { enumerable: true, get: function () { return __importDefault(wipeDevice_1).default; } });
|
|
134
|
+
var checkFirmwareAuthenticity_1 = require("./checkFirmwareAuthenticity");
|
|
135
|
+
Object.defineProperty(exports, "checkFirmwareAuthenticity", { enumerable: true, get: function () { return __importDefault(checkFirmwareAuthenticity_1).default; } });
|
|
134
136
|
//# sourceMappingURL=index.js.map
|
package/lib/core/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const onCall: (message: CoreMessage) => Promise<void>;
|
|
|
7
7
|
export declare class Core extends EventEmitter {
|
|
8
8
|
handleMessage(message: any, isTrustedOrigin: boolean): void;
|
|
9
9
|
dispose(): void;
|
|
10
|
-
getCurrentMethod(): (import("../api").applyFlags | import("../api").applySettings | import("../api").authorizeCoinJoin | import("../api").backupDevice | import("../api").binanceGetAddress | import("../api").binanceGetPublicKey | import("../api").binanceSignTransaction | import("../api").blockchainDisconnect | import("../api").blockchainEstimateFee | import("../api").blockchainGetAccountBalanceHistory | import("../api").blockchainGetCurrentFiatRates | import("../api").blockchainGetFiatRatesForTimestamps | import("../api").blockchainGetTransactions | import("../api").blockchainSetCustomBackend | import("../api").blockchainSubscribe | import("../api").blockchainSubscribeFiatRates | import("../api").blockchainUnsubscribe | import("../api").blockchainUnsubscribeFiatRates | import("../api").cardanoGetAddress | import("../api").cardanoGetNativeScriptHash | import("../api").cardanoGetPublicKey | import("../api").cardanoSignTransaction | import("../api").changePin | import("../api").cipherKeyValue | import("../api").composeTransaction | import("../api").eosGetPublicKey | import("../api").eosSignTransaction | import("../api").ethereumGetAddress | import("../api").ethereumGetPublicKey | import("../api").ethereumSignMessage | import("../api").ethereumSignTransaction | import("../api").ethereumSignTypedData | import("../api").ethereumVerifyMessage | import("../api").firmwareUpdate | import("../api").getAccountInfo | import("../api").getAddress | import("../api").getCoinInfo | import("../api").getDeviceState | import("../api").getFeatures | import("../api").getFirmwareHash | import("../api").getOwnershipId | import("../api").getOwnershipProof | import("../api").getPublicKey | import("../api").getSettings | import("../api").nemGetAddress | import("../api").nemSignTransaction | import("../api").pushTransaction | import("../api").rebootToBootloader | import("../api").recoveryDevice | import("../api").requestLogin | import("../api").resetDevice | import("../api").rippleGetAddress | import("../api").rippleSignTransaction | import("../api").setProxy | import("../api").signMessage | import("../api").signTransaction | import("../api").stellarGetAddress | import("../api").stellarSignTransaction | import("../api").tezosGetAddress | import("../api").tezosGetPublicKey | import("../api").tezosSignTransaction | import("../api").verifyMessage | import("../api").wipeDevice)[];
|
|
10
|
+
getCurrentMethod(): (import("../api").applyFlags | import("../api").applySettings | import("../api").authorizeCoinJoin | import("../api").backupDevice | import("../api").binanceGetAddress | import("../api").binanceGetPublicKey | import("../api").binanceSignTransaction | import("../api").blockchainDisconnect | import("../api").blockchainEstimateFee | import("../api").blockchainGetAccountBalanceHistory | import("../api").blockchainGetCurrentFiatRates | import("../api").blockchainGetFiatRatesForTimestamps | import("../api").blockchainGetTransactions | import("../api").blockchainSetCustomBackend | import("../api").blockchainSubscribe | import("../api").blockchainSubscribeFiatRates | import("../api").blockchainUnsubscribe | import("../api").blockchainUnsubscribeFiatRates | import("../api").cardanoGetAddress | import("../api").cardanoGetNativeScriptHash | import("../api").cardanoGetPublicKey | import("../api").cardanoSignTransaction | import("../api").changePin | import("../api").cipherKeyValue | import("../api").composeTransaction | import("../api").eosGetPublicKey | import("../api").eosSignTransaction | import("../api").ethereumGetAddress | import("../api").ethereumGetPublicKey | import("../api").ethereumSignMessage | import("../api").ethereumSignTransaction | import("../api").ethereumSignTypedData | import("../api").ethereumVerifyMessage | import("../api").firmwareUpdate | import("../api").getAccountInfo | import("../api").getAddress | import("../api").getCoinInfo | import("../api").getDeviceState | import("../api").getFeatures | import("../api").getFirmwareHash | import("../api").getOwnershipId | import("../api").getOwnershipProof | import("../api").getPublicKey | import("../api").getSettings | import("../api").nemGetAddress | import("../api").nemSignTransaction | import("../api").pushTransaction | import("../api").rebootToBootloader | import("../api").recoveryDevice | import("../api").requestLogin | import("../api").resetDevice | import("../api").rippleGetAddress | import("../api").rippleSignTransaction | import("../api").setProxy | import("../api").signMessage | import("../api").signTransaction | import("../api").stellarGetAddress | import("../api").stellarSignTransaction | import("../api").tezosGetAddress | import("../api").tezosGetPublicKey | import("../api").tezosSignTransaction | import("../api").verifyMessage | import("../api").wipeDevice | import("../api").checkFirmwareAuthenticity)[];
|
|
11
11
|
getTransportInfo(): TransportInfo;
|
|
12
12
|
}
|
|
13
13
|
export declare const initCore: () => Core;
|
package/lib/core/method.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import * as Methods from '../api';
|
|
|
2
2
|
import type { IFrameCallMessage } from '../events';
|
|
3
3
|
export declare const getMethod: (message: IFrameCallMessage & {
|
|
4
4
|
id?: number;
|
|
5
|
-
}) => Methods.applyFlags | Methods.applySettings | Methods.authorizeCoinJoin | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getFirmwareHash | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.verifyMessage | Methods.wipeDevice;
|
|
5
|
+
}) => Methods.applyFlags | Methods.applySettings | Methods.authorizeCoinJoin | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getFirmwareHash | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.verifyMessage | Methods.wipeDevice | Methods.checkFirmwareAuthenticity;
|
|
6
6
|
//# sourceMappingURL=method.d.ts.map
|
package/lib/data/version.d.ts
CHANGED
package/lib/data/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '9.0.
|
|
4
|
+
exports.VERSION = '9.0.1';
|
|
5
5
|
const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
|
|
6
6
|
exports.DEFAULT_DOMAIN = `https://connect.trezor.io/${versionN[0]}/`;
|
|
7
7
|
//# sourceMappingURL=version.js.map
|
package/lib/device/Device.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export declare class Device extends EventEmitter {
|
|
|
51
51
|
externalState: string[];
|
|
52
52
|
unavailableCapabilities: UnavailableCapabilities;
|
|
53
53
|
networkTypeState: NETWORK.NetworkType[];
|
|
54
|
+
firmwareType: 'regular' | 'bitcoin-only';
|
|
54
55
|
constructor(transport: Transport, descriptor: DeviceDescriptor);
|
|
55
56
|
static fromDescriptor(transport: Transport, originalDescriptor: DeviceDescriptor): Device;
|
|
56
57
|
static createUnacquired(transport: Transport, descriptor: DeviceDescriptor, unreadableError?: string): Device;
|
package/lib/device/Device.js
CHANGED
|
@@ -31,6 +31,7 @@ class Device extends events_1.default {
|
|
|
31
31
|
this.externalState = [];
|
|
32
32
|
this.unavailableCapabilities = {};
|
|
33
33
|
this.networkTypeState = [];
|
|
34
|
+
this.firmwareType = 'regular';
|
|
34
35
|
this.transport = transport;
|
|
35
36
|
this.originalDescriptor = descriptor;
|
|
36
37
|
this.firstRunPromise = (0, deferred_1.create)();
|
|
@@ -305,6 +306,12 @@ class Device extends events_1.default {
|
|
|
305
306
|
feat.revision = revision;
|
|
306
307
|
this.features = feat;
|
|
307
308
|
this.featuresNeedsReload = false;
|
|
309
|
+
this.firmwareType =
|
|
310
|
+
feat.capabilities &&
|
|
311
|
+
feat.capabilities.length > 0 &&
|
|
312
|
+
!feat.capabilities.includes('Capability_Bitcoin_like')
|
|
313
|
+
? 'bitcoin-only'
|
|
314
|
+
: 'regular';
|
|
308
315
|
}
|
|
309
316
|
isUnacquired() {
|
|
310
317
|
return this.features === undefined;
|
|
@@ -482,6 +489,7 @@ class Device extends events_1.default {
|
|
|
482
489
|
mode: this.getMode(),
|
|
483
490
|
firmware: this.firmwareStatus,
|
|
484
491
|
firmwareRelease: this.firmwareRelease,
|
|
492
|
+
firmwareType: this.firmwareType,
|
|
485
493
|
features: this.features,
|
|
486
494
|
unavailableCapabilities: this.unavailableCapabilities,
|
|
487
495
|
};
|
package/lib/factory.js
CHANGED
|
@@ -106,6 +106,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
|
|
|
106
106
|
verifyMessage: params => call({ ...params, method: 'verifyMessage' }),
|
|
107
107
|
resetDevice: params => call({ ...params, method: 'resetDevice' }),
|
|
108
108
|
wipeDevice: params => call({ ...params, method: 'wipeDevice' }),
|
|
109
|
+
checkFirmwareAuthenticity: params => call({ ...params, method: 'checkFirmwareAuthenticity' }),
|
|
109
110
|
applyFlags: params => call({ ...params, method: 'applyFlags' }),
|
|
110
111
|
applySettings: params => call({ ...params, method: 'applySettings' }),
|
|
111
112
|
authorizeCoinJoin: params => call({ ...params, method: 'authorizeCoinJoin' }),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Response, CommonParams } from '../params';
|
|
2
|
+
export interface CheckFirmwareAuthenticityResponse {
|
|
3
|
+
expectedFirmwareHash: string;
|
|
4
|
+
actualFirmwareHash: string;
|
|
5
|
+
valid: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function checkFirmwareAuthenticity(params: CommonParams): Response<CheckFirmwareAuthenticityResponse>;
|
|
8
|
+
//# sourceMappingURL=checkFirmwareAuthenticity.d.ts.map
|
package/lib/types/api/index.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ import { tezosSignTransaction } from './tezosSignTransaction';
|
|
|
71
71
|
import { uiResponse } from './uiResponse';
|
|
72
72
|
import { verifyMessage } from './verifyMessage';
|
|
73
73
|
import { wipeDevice } from './wipeDevice';
|
|
74
|
+
import { checkFirmwareAuthenticity } from './checkFirmwareAuthenticity';
|
|
74
75
|
export interface TrezorConnect {
|
|
75
76
|
applyFlags: typeof applyFlags;
|
|
76
77
|
applySettings: typeof applySettings;
|
|
@@ -145,5 +146,6 @@ export interface TrezorConnect {
|
|
|
145
146
|
uiResponse: typeof uiResponse;
|
|
146
147
|
verifyMessage: typeof verifyMessage;
|
|
147
148
|
wipeDevice: typeof wipeDevice;
|
|
149
|
+
checkFirmwareAuthenticity: typeof checkFirmwareAuthenticity;
|
|
148
150
|
}
|
|
149
151
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/device.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare type DeviceStatus = 'available' | 'occupied' | 'used';
|
|
|
4
4
|
export declare type DeviceMode = 'normal' | 'bootloader' | 'initialize' | 'seedless';
|
|
5
5
|
export declare type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none';
|
|
6
6
|
export declare type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated';
|
|
7
|
+
export declare type FirmwareType = 'bitcoin-only' | 'regular';
|
|
7
8
|
export declare type UnavailableCapabilities = {
|
|
8
9
|
[key: string]: UnavailableCapability;
|
|
9
10
|
};
|
|
@@ -15,6 +16,7 @@ export declare type KnownDevice = {
|
|
|
15
16
|
error?: typeof undefined;
|
|
16
17
|
firmware: DeviceFirmwareStatus;
|
|
17
18
|
firmwareRelease?: ReleaseInfo | null;
|
|
19
|
+
firmwareType?: FirmwareType;
|
|
18
20
|
status: DeviceStatus;
|
|
19
21
|
mode: DeviceMode;
|
|
20
22
|
state?: string;
|
|
@@ -30,6 +32,7 @@ export declare type UnknownDevice = {
|
|
|
30
32
|
features?: typeof undefined;
|
|
31
33
|
firmware?: typeof undefined;
|
|
32
34
|
firmwareRelease?: typeof undefined;
|
|
35
|
+
firmwareType?: typeof undefined;
|
|
33
36
|
status?: typeof undefined;
|
|
34
37
|
mode?: typeof undefined;
|
|
35
38
|
state?: typeof undefined;
|
|
@@ -44,6 +47,7 @@ export declare type UnreadableDevice = {
|
|
|
44
47
|
features?: typeof undefined;
|
|
45
48
|
firmware?: typeof undefined;
|
|
46
49
|
firmwareRelease?: typeof undefined;
|
|
50
|
+
firmwareType?: typeof undefined;
|
|
47
51
|
status?: typeof undefined;
|
|
48
52
|
mode?: typeof undefined;
|
|
49
53
|
state?: typeof undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trezor/connect",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.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.",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"!**/*.map"
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
|
-
"lint": "eslint '**/*.{ts,tsx,js}'",
|
|
37
|
+
"lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'",
|
|
38
38
|
"test:unit": "jest",
|
|
39
39
|
"type-check": "tsc --build",
|
|
40
40
|
"build:lib": "rimraf ./lib && yarn tsc --build tsconfig.lib.json",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"version:major": "tsx scripts/bump-version.ts major"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@trezor/blockchain-link": "^2.1.
|
|
47
|
+
"@trezor/blockchain-link": "^2.1.4",
|
|
48
48
|
"@trezor/connect-common": "0.0.9",
|
|
49
49
|
"@trezor/transport": "^1.1.4",
|
|
50
50
|
"@trezor/utils": "^9.0.2",
|