@trezor/connect 9.0.6 → 9.0.7
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 +9 -2
- package/README.md +1 -1
- package/lib/api/authorizeCoinjoin.d.ts +7 -0
- package/lib/api/{authorizeCoinJoin.js → authorizeCoinjoin.js} +3 -3
- package/lib/api/index.d.ts +1 -1
- package/lib/api/index.js +3 -3
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.js +11 -4
- package/lib/core/method.d.ts +1 -1
- package/lib/data/DataManager.d.ts +1 -1
- package/lib/data/DataManager.js +3 -2
- package/lib/data/config.js +1 -1
- package/lib/data/connectSettings.js +4 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.js +1 -2
- package/lib/device/DeviceCommands.js +4 -6
- package/lib/device/DeviceList.js +10 -12
- package/lib/events/transport.d.ts +2 -1
- package/lib/factory.js +1 -1
- package/lib/index.js +4 -0
- package/lib/types/api/{authorizeCoinJoin.d.ts → authorizeCoinjoin.d.ts} +3 -3
- package/lib/types/api/{authorizeCoinJoin.js → authorizeCoinjoin.js} +1 -1
- package/lib/types/api/index.d.ts +2 -2
- package/lib/types/params.d.ts +1 -0
- package/lib/types/settings.d.ts +2 -0
- package/package.json +12 -11
- package/lib/api/authorizeCoinJoin.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# 9.0.7
|
|
2
|
+
|
|
3
|
+
- feat(connect-ui): connect UI will now display a warning in case it was opened by an application listed in https://github.com/MetaMask/eth-phishing-detect (#7488)
|
|
4
|
+
- fix(connect-ui): set max pin input length to 50 instead of 9 (#7668)
|
|
5
|
+
- fix(connect): ltc spending problem (#7666)
|
|
6
|
+
- change(connect): TrezorConnect.init `webusb` option is now deprecated. It was replaced with `transports` param `('BridgeTransport' | 'WebUsbTransport')[]`. (#7411)
|
|
7
|
+
|
|
1
8
|
# 9.0.6
|
|
2
9
|
|
|
3
10
|
- fix: list tslib as direct dependency
|
|
@@ -22,7 +29,7 @@
|
|
|
22
29
|
- added `setBusy` method
|
|
23
30
|
- added `goerli` (TGOR) coin support
|
|
24
31
|
- added `serialize` and `coinjoinRequest` option to `signTransaction` method
|
|
25
|
-
- added `preauthorized` option to `
|
|
32
|
+
- added `preauthorized` option to `authorizeCoinjoin` method
|
|
26
33
|
- Cardano: added support for [CIP36 Catalyst registration format](https://cips.cardano.org/cips/cip36/) in `cardanoSignTransaction` method
|
|
27
34
|
- `auxiliaryData.catalystRegistrationParameters` is deprecated, use `auxiliaryData.governanceRegistrationParameters` instead
|
|
28
35
|
|
|
@@ -69,6 +76,6 @@
|
|
|
69
76
|
|
|
70
77
|
- `getOwnershipId` method
|
|
71
78
|
- `getOwnershipProof` method
|
|
72
|
-
- `
|
|
79
|
+
- `authorizeCoinjoin` method
|
|
73
80
|
- `getFirmwareHash` method
|
|
74
81
|
- [support for babbage features in cardano](https://github.com/trezor/trezor-suite/commit/efe9c78a2f74a1b7653b3fddf6cca35ba38d3ae9)
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @trezor/connect
|
|
2
2
|
|
|
3
|
-
API version 9.0.
|
|
3
|
+
API version 9.0.7
|
|
4
4
|
|
|
5
5
|
[](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
|
|
6
6
|
[](https://www.npmjs.org/package/@trezor/connect)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import { PROTO } from '../constants';
|
|
3
|
+
export default class AuthorizeCoinjoin extends AbstractMethod<'authorizeCoinjoin', PROTO.AuthorizeCoinJoin> {
|
|
4
|
+
init(): void;
|
|
5
|
+
run(): Promise<PROTO.Success>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=authorizeCoinjoin.d.ts.map
|
|
@@ -4,7 +4,7 @@ const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
|
4
4
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
5
|
const pathUtils_1 = require("../utils/pathUtils");
|
|
6
6
|
const coinInfo_1 = require("../data/coinInfo");
|
|
7
|
-
class
|
|
7
|
+
class AuthorizeCoinjoin extends AbstractMethod_1.AbstractMethod {
|
|
8
8
|
init() {
|
|
9
9
|
const { payload } = this;
|
|
10
10
|
(0, paramsValidator_1.validateParams)(payload, [
|
|
@@ -45,5 +45,5 @@ class AuthorizeCoinJoin extends AbstractMethod_1.AbstractMethod {
|
|
|
45
45
|
return response.message;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
exports.default =
|
|
49
|
-
//# sourceMappingURL=
|
|
48
|
+
exports.default = AuthorizeCoinjoin;
|
|
49
|
+
//# sourceMappingURL=authorizeCoinjoin.js.map
|
package/lib/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as applyFlags } from './applyFlags';
|
|
2
2
|
export { default as applySettings } from './applySettings';
|
|
3
|
-
export { default as
|
|
3
|
+
export { default as authorizeCoinjoin } from './authorizeCoinjoin';
|
|
4
4
|
export { default as backupDevice } from './backupDevice';
|
|
5
5
|
export { default as binanceGetAddress } from './binanceGetAddress';
|
|
6
6
|
export { default as binanceGetPublicKey } from './binanceGetPublicKey';
|
package/lib/api/index.js
CHANGED
|
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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.
|
|
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
7
|
exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.unlockPath = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.setBusy = 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");
|
|
11
11
|
Object.defineProperty(exports, "applySettings", { enumerable: true, get: function () { return __importDefault(applySettings_1).default; } });
|
|
12
|
-
var
|
|
13
|
-
Object.defineProperty(exports, "
|
|
12
|
+
var authorizeCoinjoin_1 = require("./authorizeCoinjoin");
|
|
13
|
+
Object.defineProperty(exports, "authorizeCoinjoin", { enumerable: true, get: function () { return __importDefault(authorizeCoinjoin_1).default; } });
|
|
14
14
|
var backupDevice_1 = require("./backupDevice");
|
|
15
15
|
Object.defineProperty(exports, "backupDevice", { enumerable: true, get: function () { return __importDefault(backupDevice_1).default; } });
|
|
16
16
|
var binanceGetAddress_1 = require("./binanceGetAddress");
|
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(): Promise<void>;
|
|
10
|
-
getCurrentMethod(): (import("../api").applyFlags | import("../api").applySettings | import("../api").
|
|
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").setBusy | 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").unlockPath | 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/index.js
CHANGED
|
@@ -75,6 +75,7 @@ const handleMessage = (message, isTrustedOrigin = false) => {
|
|
|
75
75
|
disableWebUSBTransport();
|
|
76
76
|
break;
|
|
77
77
|
case events_2.TRANSPORT.REQUEST_DEVICE:
|
|
78
|
+
_deviceList === null || _deviceList === void 0 ? void 0 : _deviceList.enumerate();
|
|
78
79
|
break;
|
|
79
80
|
case events_2.UI.RECEIVE_DEVICE:
|
|
80
81
|
case events_2.UI.RECEIVE_CONFIRMATION:
|
|
@@ -105,7 +106,7 @@ const initDevice = async (method) => {
|
|
|
105
106
|
if (!_deviceList) {
|
|
106
107
|
throw constants_1.ERRORS.TypedError('Transport_Missing');
|
|
107
108
|
}
|
|
108
|
-
const isWebUsb = _deviceList.transportType() === '
|
|
109
|
+
const isWebUsb = _deviceList.transportType() === 'WebUsbTransport';
|
|
109
110
|
let device;
|
|
110
111
|
let showDeviceSelection = isWebUsb;
|
|
111
112
|
if (method.devicePath) {
|
|
@@ -501,7 +502,7 @@ const handleDeviceSelectionChanges = (interruptDevice) => {
|
|
|
501
502
|
const uiPromise = findUiPromise(events_2.UI.RECEIVE_DEVICE);
|
|
502
503
|
if (uiPromise && _deviceList) {
|
|
503
504
|
const list = _deviceList.asArray();
|
|
504
|
-
const isWebUsb = _deviceList.transportType()
|
|
505
|
+
const isWebUsb = _deviceList.transportType() === 'WebUsbTransport';
|
|
505
506
|
if (list.length === 1 && !isWebUsb) {
|
|
506
507
|
uiPromise.resolve({
|
|
507
508
|
type: events_2.UI.RECEIVE_DEVICE,
|
|
@@ -646,12 +647,18 @@ const initTransport = async (settings) => {
|
|
|
646
647
|
};
|
|
647
648
|
exports.initTransport = initTransport;
|
|
648
649
|
const disableWebUSBTransport = async () => {
|
|
650
|
+
var _a, _b;
|
|
649
651
|
if (!_deviceList)
|
|
650
652
|
return;
|
|
651
|
-
if (_deviceList.transportType() !== '
|
|
653
|
+
if (_deviceList.transportType() !== 'WebUsbTransport')
|
|
652
654
|
return;
|
|
653
655
|
const settings = DataManager_1.DataManager.getSettings();
|
|
654
|
-
settings.
|
|
656
|
+
if ((_a = settings.transports) === null || _a === void 0 ? void 0 : _a.includes('WebUsbTransport')) {
|
|
657
|
+
settings.transports.splice(settings.transports.indexOf('WebUsbTransport'));
|
|
658
|
+
}
|
|
659
|
+
if (!((_b = settings.transports) === null || _b === void 0 ? void 0 : _b.includes('BridgeTransport'))) {
|
|
660
|
+
settings.transports.unshift('BridgeTransport');
|
|
661
|
+
}
|
|
655
662
|
try {
|
|
656
663
|
await _deviceList.dispose();
|
|
657
664
|
await initDeviceList(settings);
|
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.
|
|
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.setBusy | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.unlockPath | Methods.verifyMessage | Methods.wipeDevice | Methods.checkFirmwareAuthenticity;
|
|
6
6
|
//# sourceMappingURL=method.d.ts.map
|
|
@@ -16,7 +16,7 @@ export declare class DataManager {
|
|
|
16
16
|
static isManagementAllowed(): {
|
|
17
17
|
origin: string;
|
|
18
18
|
} | undefined;
|
|
19
|
-
static getPriority(whitelist?: typeof config['whitelist'][0]): number;
|
|
19
|
+
static getPriority(whitelist?: (typeof config)['whitelist'][0]): number;
|
|
20
20
|
static getHostLabel(origin: string): {
|
|
21
21
|
origin: string;
|
|
22
22
|
label: string;
|
package/lib/data/DataManager.js
CHANGED
|
@@ -11,6 +11,7 @@ const transportInfo_1 = require("./transportInfo");
|
|
|
11
11
|
const config_1 = require("./config");
|
|
12
12
|
class DataManager {
|
|
13
13
|
static async load(settings, withAssets = true) {
|
|
14
|
+
var _a;
|
|
14
15
|
const ts = settings.env === 'web' ? `?r=${settings.timestamp}` : '';
|
|
15
16
|
this.settings = settings;
|
|
16
17
|
const isLocalhost = typeof window !== 'undefined' && window.location
|
|
@@ -30,8 +31,8 @@ class DataManager {
|
|
|
30
31
|
this.settings.hostLabel = knownHost.label;
|
|
31
32
|
this.settings.hostIcon = knownHost.icon;
|
|
32
33
|
}
|
|
33
|
-
if (this.settings.popup && this.settings.
|
|
34
|
-
this.settings.
|
|
34
|
+
if (this.settings.popup && this.settings.env !== 'webextension') {
|
|
35
|
+
this.settings.transports = (_a = this.settings.transports) === null || _a === void 0 ? void 0 : _a.filter((transport) => transport !== 'WebUsbTransport');
|
|
35
36
|
}
|
|
36
37
|
if (!withAssets)
|
|
37
38
|
return;
|
package/lib/data/config.js
CHANGED
|
@@ -182,7 +182,7 @@ exports.config = {
|
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
capabilities: ['coinjoin'],
|
|
185
|
-
methods: ['
|
|
185
|
+
methods: ['authorizeCoinjoin', 'getOwnershipId', 'getOwnershipProof'],
|
|
186
186
|
min: ['0', '2.5.3'],
|
|
187
187
|
},
|
|
188
188
|
],
|
|
@@ -14,7 +14,7 @@ const initialSettings = {
|
|
|
14
14
|
popup: true,
|
|
15
15
|
popupSrc: `${version_1.DEFAULT_DOMAIN}popup.html`,
|
|
16
16
|
webusbSrc: `${version_1.DEFAULT_DOMAIN}webusb.html`,
|
|
17
|
-
|
|
17
|
+
transports: undefined,
|
|
18
18
|
pendingTransportEvent: true,
|
|
19
19
|
supportedBrowser: typeof navigator !== 'undefined' ? !/Trident|MSIE|Edge/.test(navigator.userAgent) : true,
|
|
20
20
|
env: 'web',
|
|
@@ -113,6 +113,9 @@ const parseConnectSettings = (input = {}) => {
|
|
|
113
113
|
if (typeof input.webusb === 'boolean') {
|
|
114
114
|
settings.webusb = input.webusb;
|
|
115
115
|
}
|
|
116
|
+
if (Array.isArray(input.transports)) {
|
|
117
|
+
settings.transports = input.transports;
|
|
118
|
+
}
|
|
116
119
|
if (typeof input.popup === 'boolean') {
|
|
117
120
|
settings.popup = input.popup;
|
|
118
121
|
}
|
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.7';
|
|
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.js
CHANGED
|
@@ -123,8 +123,7 @@ class Device extends events_1.default {
|
|
|
123
123
|
await this.deferredActions[events_2.DEVICE.ACQUIRE].promise;
|
|
124
124
|
}
|
|
125
125
|
if (this.runPromise) {
|
|
126
|
-
this.
|
|
127
|
-
this.runPromise = null;
|
|
126
|
+
await this.interruptionFromUser(error);
|
|
128
127
|
}
|
|
129
128
|
if (!this.keepSession && this.deferredActions[events_2.DEVICE.RELEASE]) {
|
|
130
129
|
await this.deferredActions[events_2.DEVICE.RELEASE].promise;
|
|
@@ -474,15 +474,13 @@ class DeviceCommands {
|
|
|
474
474
|
if (this.disposed) {
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
|
-
const {
|
|
478
|
-
if (
|
|
479
|
-
activeName === 'BridgeTransport' &&
|
|
480
|
-
(0, versionUtils_1.versionCompare)(version, '2.0.28') < 1) {
|
|
477
|
+
const { name, version } = this.transport;
|
|
478
|
+
if (name === 'BridgeTransport' && (0, versionUtils_1.versionCompare)(version, '2.0.28') < 1) {
|
|
481
479
|
await this.device.legacyForceRelease();
|
|
482
480
|
}
|
|
483
481
|
else {
|
|
484
|
-
await this.transport.post(this.sessionId, 'Cancel', {}, false);
|
|
485
|
-
await this.transport.read(this.sessionId, false);
|
|
482
|
+
await this.transport.post(this.sessionId, 'Cancel', {}, false).catch(() => { });
|
|
483
|
+
await this.transport.read(this.sessionId, false).catch(() => { });
|
|
486
484
|
}
|
|
487
485
|
}
|
|
488
486
|
}
|
package/lib/device/DeviceList.js
CHANGED
|
@@ -25,12 +25,16 @@ class DeviceList extends events_1.default {
|
|
|
25
25
|
this.creatingDevicesDescriptors = {};
|
|
26
26
|
this.transportStartPending = 0;
|
|
27
27
|
this.penalizedDevices = {};
|
|
28
|
-
const { env
|
|
28
|
+
const { env } = DataManager_1.DataManager.settings;
|
|
29
|
+
let { transports: transportSettings } = DataManager_1.DataManager.settings;
|
|
29
30
|
const transports = [];
|
|
31
|
+
if (!(transportSettings === null || transportSettings === void 0 ? void 0 : transportSettings.length)) {
|
|
32
|
+
transportSettings = ['BridgeTransport', 'WebUsbTransport'];
|
|
33
|
+
}
|
|
30
34
|
if (env === 'react-native' && typeof workers_1.ReactNativeUsbPlugin !== 'undefined') {
|
|
31
35
|
transports.push((0, workers_1.ReactNativeUsbPlugin)());
|
|
32
36
|
}
|
|
33
|
-
else {
|
|
37
|
+
else if (transportSettings === null || transportSettings === void 0 ? void 0 : transportSettings.includes('BridgeTransport')) {
|
|
34
38
|
const bridgeLatestVersion = (0, transportInfo_1.getBridgeInfo)().version.join('.');
|
|
35
39
|
const bridge = new BridgeV2(undefined, undefined);
|
|
36
40
|
bridge.setBridgeLatestVersion(bridgeLatestVersion);
|
|
@@ -41,7 +45,7 @@ class DeviceList extends events_1.default {
|
|
|
41
45
|
BridgeV2.setFetch(fetchWithSignal, isNode);
|
|
42
46
|
transports.push(bridge);
|
|
43
47
|
}
|
|
44
|
-
if (
|
|
48
|
+
if ((transportSettings === null || transportSettings === void 0 ? void 0 : transportSettings.includes('WebUsbTransport')) && typeof workers_1.WebUsbPlugin !== 'undefined') {
|
|
45
49
|
transports.push((0, workers_1.WebUsbPlugin)());
|
|
46
50
|
}
|
|
47
51
|
this.transport = new Fallback(transports);
|
|
@@ -56,7 +60,7 @@ class DeviceList extends events_1.default {
|
|
|
56
60
|
await transport.configure(JSON.stringify(this.messages));
|
|
57
61
|
_log.debug('Configuring transports done');
|
|
58
62
|
const { activeName } = transport;
|
|
59
|
-
if (activeName === '
|
|
63
|
+
if (activeName === 'WebUsbTransport') {
|
|
60
64
|
this.transportPlugin = transport.activeTransport.plugin;
|
|
61
65
|
}
|
|
62
66
|
await this._initStream();
|
|
@@ -156,15 +160,9 @@ class DeviceList extends events_1.default {
|
|
|
156
160
|
return this.asArray().length;
|
|
157
161
|
}
|
|
158
162
|
transportType() {
|
|
159
|
-
const { transport
|
|
163
|
+
const { transport } = this;
|
|
160
164
|
const { activeName } = transport;
|
|
161
|
-
|
|
162
|
-
return 'bridge';
|
|
163
|
-
}
|
|
164
|
-
if (transportPlugin) {
|
|
165
|
-
return transportPlugin.name;
|
|
166
|
-
}
|
|
167
|
-
return transport.name;
|
|
165
|
+
return activeName || 'UnknownTransport';
|
|
168
166
|
}
|
|
169
167
|
getTransportInfo() {
|
|
170
168
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MessageFactoryFn } from '../types/utils';
|
|
2
|
+
import type { Transport } from '@trezor/transport';
|
|
2
3
|
export declare const TRANSPORT_EVENT = "TRANSPORT_EVENT";
|
|
3
4
|
export declare const TRANSPORT: {
|
|
4
5
|
readonly START: "transport-start";
|
|
@@ -32,7 +33,7 @@ export interface UdevInfo {
|
|
|
32
33
|
}[];
|
|
33
34
|
}
|
|
34
35
|
export interface TransportInfo {
|
|
35
|
-
type:
|
|
36
|
+
type: Transport['name'];
|
|
36
37
|
version: string;
|
|
37
38
|
outdated: boolean;
|
|
38
39
|
bridge?: BridgeInfo;
|
package/lib/factory.js
CHANGED
|
@@ -110,7 +110,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
|
|
|
110
110
|
checkFirmwareAuthenticity: params => call({ ...params, method: 'checkFirmwareAuthenticity' }),
|
|
111
111
|
applyFlags: params => call({ ...params, method: 'applyFlags' }),
|
|
112
112
|
applySettings: params => call({ ...params, method: 'applySettings' }),
|
|
113
|
-
|
|
113
|
+
authorizeCoinjoin: params => call({ ...params, method: 'authorizeCoinjoin' }),
|
|
114
114
|
backupDevice: params => call({ ...params, method: 'backupDevice' }),
|
|
115
115
|
changePin: params => call({ ...params, method: 'changePin' }),
|
|
116
116
|
firmwareUpdate: params => call({ ...params, method: 'firmwareUpdate' }),
|
package/lib/index.js
CHANGED
|
@@ -90,6 +90,7 @@ function postMessage(message, usePromise = true) {
|
|
|
90
90
|
_core.handleMessage(message, true);
|
|
91
91
|
}
|
|
92
92
|
const init = async (settings = {}) => {
|
|
93
|
+
var _a;
|
|
93
94
|
if (_core) {
|
|
94
95
|
throw constants_1.ERRORS.TypedError('Init_AlreadyInitialized');
|
|
95
96
|
}
|
|
@@ -100,6 +101,9 @@ const init = async (settings = {}) => {
|
|
|
100
101
|
if (!_settings.manifest) {
|
|
101
102
|
throw constants_1.ERRORS.TypedError('Init_ManifestMissing');
|
|
102
103
|
}
|
|
104
|
+
if (!((_a = _settings.transports) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
105
|
+
_settings.transports = ['BridgeTransport'];
|
|
106
|
+
}
|
|
103
107
|
if (_settings.lazyLoad) {
|
|
104
108
|
_settings.lazyLoad = false;
|
|
105
109
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PROTO } from '../../constants';
|
|
2
2
|
import type { Params, Response } from '../params';
|
|
3
|
-
export interface
|
|
3
|
+
export interface AuthorizeCoinjoin {
|
|
4
4
|
path: string | number[];
|
|
5
5
|
coordinator: string;
|
|
6
6
|
maxRounds: number;
|
|
@@ -11,5 +11,5 @@ export interface AuthorizeCoinJoin {
|
|
|
11
11
|
amountUnit?: PROTO.AmountUnit;
|
|
12
12
|
preauthorized?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare function
|
|
15
|
-
//# sourceMappingURL=
|
|
14
|
+
export declare function authorizeCoinjoin(params: Params<AuthorizeCoinjoin>): Response<PROTO.Success>;
|
|
15
|
+
//# sourceMappingURL=authorizeCoinjoin.d.ts.map
|
package/lib/types/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { applyFlags } from './applyFlags';
|
|
2
2
|
import { applySettings } from './applySettings';
|
|
3
|
-
import {
|
|
3
|
+
import { authorizeCoinjoin } from './authorizeCoinjoin';
|
|
4
4
|
import { backupDevice } from './backupDevice';
|
|
5
5
|
import { binanceGetAddress } from './binanceGetAddress';
|
|
6
6
|
import { binanceGetPublicKey } from './binanceGetPublicKey';
|
|
@@ -78,7 +78,7 @@ import { checkFirmwareAuthenticity } from './checkFirmwareAuthenticity';
|
|
|
78
78
|
export interface TrezorConnect {
|
|
79
79
|
applyFlags: typeof applyFlags;
|
|
80
80
|
applySettings: typeof applySettings;
|
|
81
|
-
|
|
81
|
+
authorizeCoinjoin: typeof authorizeCoinjoin;
|
|
82
82
|
backupDevice: typeof backupDevice;
|
|
83
83
|
binanceGetAddress: typeof binanceGetAddress;
|
|
84
84
|
binanceGetPublicKey: typeof binanceGetPublicKey;
|
package/lib/types/params.d.ts
CHANGED
package/lib/types/settings.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BlockchainSettings } from '@trezor/blockchain-link';
|
|
2
|
+
import type { Transport } from '@trezor/transport';
|
|
2
3
|
export interface Manifest {
|
|
3
4
|
appUrl: string;
|
|
4
5
|
email: string;
|
|
@@ -13,6 +14,7 @@ export interface ConnectSettings {
|
|
|
13
14
|
popup?: boolean;
|
|
14
15
|
transportReconnect?: boolean;
|
|
15
16
|
webusb?: boolean;
|
|
17
|
+
transports?: Transport['name'][];
|
|
16
18
|
pendingTransportEvent?: boolean;
|
|
17
19
|
lazyLoad?: boolean;
|
|
18
20
|
interactionTimeout?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trezor/connect",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.7",
|
|
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.",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"prepublish": "yarn tsx ../../scripts/prepublish.js"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@trezor/blockchain-link": "^2.1.
|
|
53
|
-
"@trezor/connect-common": "0.0.
|
|
54
|
-
"@trezor/transport": "^1.1.
|
|
55
|
-
"@trezor/utils": "^9.0.
|
|
56
|
-
"@trezor/utxo-lib": "^1.0.
|
|
57
|
-
"bignumber.js": "^9.1.
|
|
52
|
+
"@trezor/blockchain-link": "^2.1.8",
|
|
53
|
+
"@trezor/connect-common": "0.0.12",
|
|
54
|
+
"@trezor/transport": "^1.1.8",
|
|
55
|
+
"@trezor/utils": "^9.0.6",
|
|
56
|
+
"@trezor/utxo-lib": "^1.0.4",
|
|
57
|
+
"bignumber.js": "^9.1.1",
|
|
58
58
|
"blakejs": "^1.2.1",
|
|
59
59
|
"bowser": "^2.11.0",
|
|
60
60
|
"cross-fetch": "^3.1.5",
|
|
@@ -75,11 +75,12 @@
|
|
|
75
75
|
"karma-chrome-launcher": "^3.1.1",
|
|
76
76
|
"karma-jasmine": "^5.1.0",
|
|
77
77
|
"karma-jasmine-async": "^0.0.1",
|
|
78
|
-
"karma-sourcemap-loader": "^0.
|
|
78
|
+
"karma-sourcemap-loader": "^0.4.0",
|
|
79
79
|
"karma-webpack": "^5.0.0",
|
|
80
|
-
"rimraf": "^
|
|
80
|
+
"rimraf": "^4.1.2",
|
|
81
|
+
"ts-loader": "^9.4.2",
|
|
81
82
|
"ts-node": "^10.9.1",
|
|
82
|
-
"tsx": "^3.
|
|
83
|
-
"typescript": "4.9.
|
|
83
|
+
"tsx": "^3.12.3",
|
|
84
|
+
"typescript": "4.9.5"
|
|
84
85
|
}
|
|
85
86
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
-
import { PROTO } from '../constants';
|
|
3
|
-
export default class AuthorizeCoinJoin extends AbstractMethod<'authorizeCoinJoin', PROTO.AuthorizeCoinJoin> {
|
|
4
|
-
init(): void;
|
|
5
|
-
run(): Promise<PROTO.Success>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=authorizeCoinJoin.d.ts.map
|