@trezor/connect 9.0.3 → 9.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +1 -1
- package/lib/api/authorizeCoinJoin.js +6 -2
- package/lib/api/binanceGetAddress.d.ts +1 -1
- package/lib/api/binanceSignTransaction.d.ts +1 -1
- package/lib/api/bitcoin/Fees.d.ts +1 -1
- package/lib/api/bitcoin/TransactionComposer.d.ts +1 -1
- package/lib/api/bitcoin/enhanceSignTx.js +1 -1
- package/lib/api/bitcoin/inputs.js +3 -2
- package/lib/api/bitcoin/refTx.js +3 -3
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/blockchainDisconnect.d.ts +1 -1
- package/lib/api/blockchainDisconnect.js +1 -1
- package/lib/api/blockchainEstimateFee.d.ts +1 -1
- package/lib/api/blockchainGetAccountBalanceHistory.d.ts +1 -1
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
- package/lib/api/blockchainGetTransactions.d.ts +1 -1
- package/lib/api/blockchainSetCustomBackend.d.ts +1 -1
- package/lib/api/blockchainSetCustomBackend.js +1 -1
- package/lib/api/blockchainSubscribe.d.ts +1 -1
- package/lib/api/blockchainSubscribeFiatRates.d.ts +1 -1
- package/lib/api/blockchainUnsubscribe.d.ts +1 -1
- package/lib/api/blockchainUnsubscribeFiatRates.d.ts +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.js +38 -16
- package/lib/api/cardano/cardanoCertificate.d.ts +2 -2
- package/lib/api/cardano/cardanoInputs.d.ts +3 -3
- package/lib/api/cardano/cardanoOutputs.d.ts +1 -1
- package/lib/api/cardano/cardanoTokenBundle.d.ts +1 -1
- package/lib/api/cardanoGetAddress.d.ts +1 -1
- package/lib/api/cardanoSignTransaction.d.ts +2 -1
- package/lib/api/cardanoSignTransaction.js +23 -3
- package/lib/api/common/Discovery.d.ts +2 -2
- package/lib/api/common/paramsValidator.d.ts +2 -2
- package/lib/api/composeTransaction.d.ts +1 -1
- package/lib/api/eos/eosSignTx.js +1 -1
- package/lib/api/eosSignTransaction.d.ts +1 -1
- package/lib/api/ethereumGetAddress.d.ts +1 -1
- package/lib/api/ethereumGetPublicKey.d.ts +1 -1
- package/lib/api/ethereumSignTransaction.d.ts +1 -1
- package/lib/api/ethereumSignTypedData.d.ts +1 -1
- package/lib/api/firmware/uploadFirmware.d.ts +2 -2
- package/lib/api/firmwareUpdate.d.ts +1 -1
- package/lib/api/firmwareUpdate.js +1 -1
- package/lib/api/getAccountInfo.d.ts +1 -1
- package/lib/api/getAddress.d.ts +1 -1
- package/lib/api/getCoinInfo.d.ts +2 -2
- package/lib/api/getOwnershipProof.d.ts +1 -5
- package/lib/api/getOwnershipProof.js +5 -3
- package/lib/api/getPublicKey.d.ts +1 -1
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +3 -1
- package/lib/api/nemGetAddress.d.ts +1 -1
- package/lib/api/pushTransaction.d.ts +1 -1
- package/lib/api/rippleGetAddress.d.ts +1 -1
- package/lib/api/setBusy.d.ts +7 -0
- package/lib/api/setBusy.js +31 -0
- package/lib/api/setProxy.js +3 -4
- package/lib/api/signTransaction.d.ts +2 -2
- package/lib/api/signTransaction.js +10 -3
- package/lib/api/stellarGetAddress.d.ts +1 -1
- package/lib/api/stellarSignTransaction.d.ts +1 -1
- package/lib/api/tezosGetAddress.d.ts +1 -1
- package/lib/backend/BackendManager.d.ts +21 -0
- package/lib/backend/BackendManager.js +87 -0
- package/lib/backend/Blockchain.d.ts +66 -0
- package/lib/backend/Blockchain.js +189 -0
- package/lib/backend/BlockchainLink.d.ts +6 -71
- package/lib/backend/BlockchainLink.js +12 -288
- package/lib/constants/cardano.d.ts +3 -1
- package/lib/constants/cardano.js +3 -1
- package/lib/constants/network.d.ts +1 -1
- package/lib/core/AbstractMethod.d.ts +5 -4
- package/lib/core/AbstractMethod.js +7 -5
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.js +3 -1
- package/lib/core/method.d.ts +1 -1
- package/lib/data/DataManager.d.ts +1 -1
- package/lib/data/analyticsInfo.d.ts +6 -0
- package/lib/data/analyticsInfo.js +37 -0
- package/lib/data/config.js +1 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/AbortController.d.ts +1 -1
- package/lib/device/DescriptorStream.d.ts +1 -1
- package/lib/device/Device.d.ts +2 -2
- package/lib/device/Device.js +11 -2
- package/lib/device/DeviceCommands.d.ts +8 -7
- package/lib/device/DeviceCommands.js +14 -1
- package/lib/device/DeviceList.d.ts +1 -1
- package/lib/events/blockchain.d.ts +4 -5
- package/lib/events/call.d.ts +10 -10
- package/lib/events/core.d.ts +3 -2
- package/lib/events/device.d.ts +3 -3
- package/lib/events/iframe.d.ts +2 -2
- package/lib/events/popup.d.ts +2 -2
- package/lib/events/transport.d.ts +3 -3
- package/lib/events/ui-promise.d.ts +2 -2
- package/lib/events/ui-request.d.ts +8 -6
- package/lib/events/ui-response.d.ts +2 -2
- package/lib/factory.js +1 -0
- package/lib/types/account.d.ts +2 -2
- package/lib/types/api/authorizeCoinJoin.d.ts +1 -0
- package/lib/types/api/binance/index.d.ts +1 -1
- package/lib/types/api/bitcoin/index.d.ts +6 -2
- package/lib/types/api/blockchainGetTransactions.d.ts +1 -1
- package/lib/types/api/blockchainSetCustomBackend.d.ts +1 -1
- package/lib/types/api/blockchainSubscribe.d.ts +1 -1
- package/lib/types/api/blockchainSubscribeFiatRates.d.ts +1 -1
- package/lib/types/api/cardano/index.d.ts +12 -5
- package/lib/types/api/composeTransaction.d.ts +3 -3
- package/lib/types/api/eos/index.d.ts +1 -1
- package/lib/types/api/getAddress.d.ts +1 -1
- package/lib/types/api/index.d.ts +2 -0
- package/lib/types/api/nem/index.d.ts +9 -9
- package/lib/types/api/off.d.ts +2 -2
- package/lib/types/api/on.d.ts +2 -2
- package/lib/types/api/pushTransaction.d.ts +1 -1
- package/lib/types/api/setBusy.d.ts +4 -0
- package/lib/types/api/setBusy.js +3 -0
- package/lib/types/api/setProxy.d.ts +1 -2
- package/lib/types/api/stellar/index.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +3 -3
- package/lib/types/device.d.ts +13 -13
- package/lib/types/firmware.d.ts +3 -3
- package/lib/types/params.d.ts +3 -3
- package/lib/types/settings.d.ts +1 -2
- package/lib/types/utils.d.ts +2 -2
- package/lib/utils/accountUtils.d.ts +1 -1
- package/lib/utils/browserUtils.d.ts +2 -2
- package/lib/utils/debug.d.ts +1 -1
- package/lib/utils/deferred.d.ts +2 -2
- package/lib/utils/interactionTimeout.d.ts +1 -1
- package/lib/workers/RNUsbPlugin.d.ts +1 -1
- package/lib/workers/workers.d.ts +1 -1
- package/package.json +83 -78
- package/lib/utils/bufferUtils.d.ts +0 -3
- package/lib/utils/bufferUtils.js +0 -11
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").unlockPath | import("../api").verifyMessage | import("../api").wipeDevice | import("../api").checkFirmwareAuthenticity)[];
|
|
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
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const events_1 = tslib_1.__importDefault(require("events"));
|
|
6
6
|
const DataManager_1 = require("../data/DataManager");
|
|
7
7
|
const DeviceList_1 = require("../device/DeviceList");
|
|
8
|
+
const analyticsInfo_1 = require("../data/analyticsInfo");
|
|
8
9
|
const constants_1 = require("../constants");
|
|
9
10
|
const events_2 = require("../events");
|
|
10
11
|
const method_1 = require("./method");
|
|
@@ -216,6 +217,7 @@ const onCall = async (message) => {
|
|
|
216
217
|
postMessage((0, events_2.createResponseMessage)(responseID, false, { error }));
|
|
217
218
|
throw error;
|
|
218
219
|
}
|
|
220
|
+
method.postMessage = (message) => (0, analyticsInfo_1.enhancePostMessageWithAnalytics)(postMessage, message, { device: device.toMessageObject() });
|
|
219
221
|
method.setDevice(device);
|
|
220
222
|
const previousCall = _callMethods.filter(call => call && call !== method && call.devicePath === method.devicePath);
|
|
221
223
|
if (previousCall.length > 0 && method.overridePreviousCall) {
|
|
@@ -308,7 +310,7 @@ const onCall = async (message) => {
|
|
|
308
310
|
}
|
|
309
311
|
try {
|
|
310
312
|
const invalidDeviceState = method.useDeviceState
|
|
311
|
-
? await device.validateState(method.network)
|
|
313
|
+
? await device.validateState(method.network, method.preauthorized)
|
|
312
314
|
: undefined;
|
|
313
315
|
if (invalidDeviceState) {
|
|
314
316
|
if (isUsingPopup) {
|
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.unlockPath | Methods.verifyMessage | Methods.wipeDevice | Methods.checkFirmwareAuthenticity;
|
|
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
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CoreMessage, PostMessage } from '../events';
|
|
2
|
+
import type { Device } from '../types';
|
|
3
|
+
export declare const enhancePostMessageWithAnalytics: (callback: PostMessage, message: CoreMessage, data: {
|
|
4
|
+
device?: Device;
|
|
5
|
+
}) => void;
|
|
6
|
+
//# sourceMappingURL=analyticsInfo.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enhancePostMessageWithAnalytics = void 0;
|
|
4
|
+
const events_1 = require("../events");
|
|
5
|
+
const enhancePostMessageWithAnalytics = (callback, message, data) => {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7
|
+
switch (message.type) {
|
|
8
|
+
case events_1.UI_REQUEST.REQUEST_CONFIRMATION:
|
|
9
|
+
const { device } = data;
|
|
10
|
+
callback({
|
|
11
|
+
...message,
|
|
12
|
+
payload: {
|
|
13
|
+
...message.payload,
|
|
14
|
+
analytics: {
|
|
15
|
+
type: 'device/selected',
|
|
16
|
+
payload: {
|
|
17
|
+
mode: (device === null || device === void 0 ? void 0 : device.mode) || '',
|
|
18
|
+
pinProtection: ((_a = device === null || device === void 0 ? void 0 : device.features) === null || _a === void 0 ? void 0 : _a.pin_protection) || '',
|
|
19
|
+
passphraseProtection: ((_b = device === null || device === void 0 ? void 0 : device.features) === null || _b === void 0 ? void 0 : _b.passphrase_protection) || '',
|
|
20
|
+
backupType: ((_c = device === null || device === void 0 ? void 0 : device.features) === null || _c === void 0 ? void 0 : _c.backup_type) || 'Bip39',
|
|
21
|
+
language: ((_d = device === null || device === void 0 ? void 0 : device.features) === null || _d === void 0 ? void 0 : _d.language) || '',
|
|
22
|
+
model: ((_e = device === null || device === void 0 ? void 0 : device.features) === null || _e === void 0 ? void 0 : _e.model) || '',
|
|
23
|
+
vendor: ((_f = device === null || device === void 0 ? void 0 : device.features) === null || _f === void 0 ? void 0 : _f.vendor) || '',
|
|
24
|
+
firmwareRevision: ((_g = device === null || device === void 0 ? void 0 : device.features) === null || _g === void 0 ? void 0 : _g.revision) || '',
|
|
25
|
+
firmwareType: (device === null || device === void 0 ? void 0 : device.firmwareType) || '',
|
|
26
|
+
bootloaderHash: ((_h = device === null || device === void 0 ? void 0 : device.features) === null || _h === void 0 ? void 0 : _h.bootloader_hash) || '',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
callback(message);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.enhancePostMessageWithAnalytics = enhancePostMessageWithAnalytics;
|
|
37
|
+
//# sourceMappingURL=analyticsInfo.js.map
|
package/lib/data/config.js
CHANGED
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.5';
|
|
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
|
|
@@ -15,7 +15,7 @@ declare class AbortControllerFallback {
|
|
|
15
15
|
abort(): void;
|
|
16
16
|
toString(): string;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export type Controller = AbortController | AbortControllerFallback;
|
|
19
19
|
export declare const getAbortController: () => AbortControllerFallback | AbortController;
|
|
20
20
|
export {};
|
|
21
21
|
//# sourceMappingURL=AbortController.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from 'events';
|
|
3
3
|
import type { Transport, TrezorDeviceInfoWithSession as DeviceDescriptor } from '@trezor/transport';
|
|
4
|
-
export
|
|
4
|
+
export type DeviceDescriptorDiff = {
|
|
5
5
|
didUpdate: boolean;
|
|
6
6
|
connected: DeviceDescriptor[];
|
|
7
7
|
disconnected: DeviceDescriptor[];
|
package/lib/device/Device.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { DEVICE, DeviceButtonRequestPayload } from '../events';
|
|
|
6
6
|
import { Deferred } from '../utils/deferred';
|
|
7
7
|
import type { Transport, TrezorDeviceInfoWithSession as DeviceDescriptor } from '@trezor/transport';
|
|
8
8
|
import type { Device as DeviceTyped, DeviceFirmwareStatus, Features, ReleaseInfo, UnavailableCapabilities } from '../types';
|
|
9
|
-
export
|
|
9
|
+
export type RunOptions = {
|
|
10
10
|
skipFinalReload?: boolean;
|
|
11
11
|
waiting?: boolean;
|
|
12
12
|
onlyOneActivity?: boolean;
|
|
@@ -70,7 +70,7 @@ export declare class Device extends EventEmitter {
|
|
|
70
70
|
getInternalState(): string;
|
|
71
71
|
setExternalState(state?: string): void;
|
|
72
72
|
getExternalState(): string;
|
|
73
|
-
validateState(networkType?: NETWORK.NetworkType): Promise<string | undefined>;
|
|
73
|
+
validateState(networkType?: NETWORK.NetworkType, preauthorized?: boolean): Promise<string | undefined>;
|
|
74
74
|
useLegacyPassphrase(): boolean;
|
|
75
75
|
initialize(useEmptyPassphrase: boolean, useCardanoDerivation: boolean): Promise<void>;
|
|
76
76
|
getFeatures(): Promise<void>;
|
package/lib/device/Device.js
CHANGED
|
@@ -241,9 +241,14 @@ class Device extends events_1.default {
|
|
|
241
241
|
getExternalState() {
|
|
242
242
|
return this.externalState[this.instance];
|
|
243
243
|
}
|
|
244
|
-
async validateState(networkType) {
|
|
244
|
+
async validateState(networkType, preauthorized = false) {
|
|
245
245
|
if (!this.features)
|
|
246
246
|
return;
|
|
247
|
+
if (!this.features.unlocked && preauthorized) {
|
|
248
|
+
if (await this.commands.preauthorize(false)) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
247
252
|
const altMode = this._altModeChange(networkType);
|
|
248
253
|
const expectedState = altMode ? undefined : this.getExternalState();
|
|
249
254
|
const state = await this.commands.getDeviceState(networkType);
|
|
@@ -287,6 +292,7 @@ class Device extends events_1.default {
|
|
|
287
292
|
this._updateFeatures(message);
|
|
288
293
|
}
|
|
289
294
|
_updateFeatures(feat) {
|
|
295
|
+
var _a;
|
|
290
296
|
const capabilities = (0, deviceFeaturesUtils_1.parseCapabilities)(feat);
|
|
291
297
|
feat.capabilities = capabilities;
|
|
292
298
|
const version = [feat.major_version, feat.minor_version, feat.patch_version];
|
|
@@ -301,9 +307,12 @@ class Device extends events_1.default {
|
|
|
301
307
|
if (this.features && this.features.session_id && !feat.session_id) {
|
|
302
308
|
feat.session_id = this.features.session_id;
|
|
303
309
|
}
|
|
304
|
-
feat.unlocked = feat.unlocked
|
|
310
|
+
feat.unlocked = (_a = feat.unlocked) !== null && _a !== void 0 ? _a : true;
|
|
305
311
|
const revision = (0, deviceFeaturesUtils_1.parseRevision)(feat);
|
|
306
312
|
feat.revision = revision;
|
|
313
|
+
if (!feat.model && feat.major_version === 1) {
|
|
314
|
+
feat.model = '1';
|
|
315
|
+
}
|
|
307
316
|
this.features = feat;
|
|
308
317
|
this.featuresNeedsReload = false;
|
|
309
318
|
this.firmwareType =
|
|
@@ -2,17 +2,17 @@ import { Transport, Messages } from '@trezor/transport';
|
|
|
2
2
|
import type { Device } from './Device';
|
|
3
3
|
import type { CoinInfo, BitcoinNetworkInfo } from '../types';
|
|
4
4
|
import type { HDNodeResponse } from '../types/api/getPublicKey';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
type MessageType = Messages.MessageType;
|
|
6
|
+
type MessageKey = keyof MessageType;
|
|
7
|
+
export type TypedResponseMessage<T extends MessageKey> = {
|
|
8
8
|
type: T;
|
|
9
9
|
message: MessageType[T];
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type TypedCallResponseMap = {
|
|
12
12
|
[K in keyof MessageType]: TypedResponseMessage<K>;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type DefaultMessageResponse = TypedCallResponseMap[keyof MessageType];
|
|
15
|
+
export type PassphrasePromptResponse = {
|
|
16
16
|
passphrase?: string;
|
|
17
17
|
passphraseOnDevice?: boolean;
|
|
18
18
|
cache?: boolean;
|
|
@@ -46,6 +46,7 @@ export declare class DeviceCommands {
|
|
|
46
46
|
address: string;
|
|
47
47
|
}>;
|
|
48
48
|
ethereumGetPublicKey({ address_n, show_display, }: Messages.EthereumGetPublicKey): Promise<HDNodeResponse>;
|
|
49
|
+
preauthorize(throwError: boolean): Promise<boolean>;
|
|
49
50
|
getDeviceState(networkType?: string): Promise<string>;
|
|
50
51
|
call(type: MessageKey, msg?: DefaultMessageResponse['message']): Promise<DefaultMessageResponse>;
|
|
51
52
|
typedCall<T extends MessageKey, R extends MessageKey[]>(type: T, resType: R, msg?: MessageType[T]): Promise<TypedCallResponseMap[R[number]]>;
|
|
@@ -63,6 +64,6 @@ export declare class DeviceCommands {
|
|
|
63
64
|
}>;
|
|
64
65
|
cancel(): Promise<void>;
|
|
65
66
|
}
|
|
66
|
-
export
|
|
67
|
+
export type TypedCall = DeviceCommands['typedCall'];
|
|
67
68
|
export {};
|
|
68
69
|
//# sourceMappingURL=DeviceCommands.d.ts.map
|
|
@@ -113,7 +113,9 @@ class DeviceCommands {
|
|
|
113
113
|
response.xpub = hdnodeUtils.convertXpub(publicKey.xpub, network, coinInfo.network);
|
|
114
114
|
}
|
|
115
115
|
if ((0, pathUtils_1.isTaprootPath)(path)) {
|
|
116
|
-
const fingerprint = Number(publicKey.root_fingerprint || 0)
|
|
116
|
+
const fingerprint = Number(publicKey.root_fingerprint || 0)
|
|
117
|
+
.toString(16)
|
|
118
|
+
.padStart(8, '0');
|
|
117
119
|
const descriptorPath = `${fingerprint}${response.serializedPath.substring(1)}`;
|
|
118
120
|
response.xpubSegwit = `tr([${descriptorPath}]${response.xpub}/<0;1>/*)`;
|
|
119
121
|
}
|
|
@@ -219,6 +221,17 @@ class DeviceCommands {
|
|
|
219
221
|
depth: publicKey.node.depth,
|
|
220
222
|
};
|
|
221
223
|
}
|
|
224
|
+
async preauthorize(throwError) {
|
|
225
|
+
try {
|
|
226
|
+
await this.typedCall('DoPreauthorized', 'PreauthorizedRequest', {});
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
if (throwError)
|
|
231
|
+
throw error;
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
222
235
|
getDeviceState(networkType) {
|
|
223
236
|
if (!this.device.atLeast('2.4.3')) {
|
|
224
237
|
return this._getAddressForNetworkType(networkType);
|
|
@@ -6,7 +6,7 @@ import { DescriptorStream } from './DescriptorStream';
|
|
|
6
6
|
import { Device } from './Device';
|
|
7
7
|
import type { Device as DeviceTyped } from '../types';
|
|
8
8
|
import type { Controller } from './AbortController';
|
|
9
|
-
|
|
9
|
+
type LowLevelPlugin = {
|
|
10
10
|
name: 'WebUsbPlugin' | 'ReactNativePlugin';
|
|
11
11
|
unreadableHidDeviceChange: {
|
|
12
12
|
on: (event: string, fn: any) => void;
|
|
@@ -11,7 +11,6 @@ export declare const BLOCKCHAIN: {
|
|
|
11
11
|
};
|
|
12
12
|
export interface BlockchainInfo extends ServerInfo {
|
|
13
13
|
coin: CoinInfo;
|
|
14
|
-
cleanUrl?: string;
|
|
15
14
|
misc?: {
|
|
16
15
|
reserve?: string;
|
|
17
16
|
};
|
|
@@ -21,7 +20,7 @@ export interface BlockchainError {
|
|
|
21
20
|
error: string;
|
|
22
21
|
code?: string;
|
|
23
22
|
}
|
|
24
|
-
export
|
|
23
|
+
export type BlockchainBlock = BlockEvent['payload'] & {
|
|
25
24
|
coin: CoinInfo;
|
|
26
25
|
};
|
|
27
26
|
export interface BlockchainNotification {
|
|
@@ -32,7 +31,7 @@ export interface BlockchainFiatRatesUpdate {
|
|
|
32
31
|
coin: CoinInfo;
|
|
33
32
|
rates: FiatRates;
|
|
34
33
|
}
|
|
35
|
-
export
|
|
34
|
+
export type BlockchainEvent = {
|
|
36
35
|
type: typeof BLOCKCHAIN.CONNECT;
|
|
37
36
|
payload: BlockchainInfo;
|
|
38
37
|
} | {
|
|
@@ -48,9 +47,9 @@ export declare type BlockchainEvent = {
|
|
|
48
47
|
type: typeof BLOCKCHAIN.FIAT_RATES_UPDATE;
|
|
49
48
|
payload: BlockchainFiatRatesUpdate;
|
|
50
49
|
};
|
|
51
|
-
export
|
|
50
|
+
export type BlockchainEventMessage = BlockchainEvent & {
|
|
52
51
|
event: typeof BLOCKCHAIN_EVENT;
|
|
53
52
|
};
|
|
54
|
-
export
|
|
53
|
+
export type BlockchainEventListenerFn = (type: typeof BLOCKCHAIN_EVENT, cb: (event: BlockchainEventMessage) => void) => void;
|
|
55
54
|
export declare const createBlockchainMessage: MessageFactoryFn<typeof BLOCKCHAIN_EVENT, BlockchainEvent>;
|
|
56
55
|
//# sourceMappingURL=blockchain.d.ts.map
|
package/lib/events/call.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import type { IFRAME } from './iframe';
|
|
2
2
|
import type { TrezorConnect } from '../types/api';
|
|
3
3
|
import type { CommonParams } from '../types/params';
|
|
4
|
-
|
|
4
|
+
type UnwrappedResponse<T> = T extends Promise<infer R> ? R extends {
|
|
5
5
|
success: true;
|
|
6
6
|
payload: infer P;
|
|
7
7
|
} ? P : never : void;
|
|
8
|
-
|
|
8
|
+
type OverloadedMethod<T, E extends Record<string, string>> = T extends {
|
|
9
9
|
(params: infer P1): infer R1;
|
|
10
10
|
(params: infer P2): infer R2;
|
|
11
11
|
} ? ((params: P1 & E) => R1) | ((params: P2 & E) => R2) : T extends (...args: infer P) => infer R ? (params: E & P[0]) => R : never;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type UnwrappedMethod<T, M extends Record<string, string>> = T extends () => infer R ? (params: M & CommonParams) => R : OverloadedMethod<T, M>;
|
|
13
|
+
type IsMethodCallable<T> = T extends (...args: any[]) => infer R ? R extends Promise<{
|
|
14
14
|
success: boolean;
|
|
15
15
|
}> ? R : never : never;
|
|
16
|
-
|
|
16
|
+
type CallApi = {
|
|
17
17
|
[K in keyof TrezorConnect]: IsMethodCallable<TrezorConnect[K]> extends never ? never : UnwrappedMethod<TrezorConnect[K], {
|
|
18
18
|
method: K;
|
|
19
19
|
}>;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
21
|
+
export type CallMethodUnion = CallApi[keyof CallApi];
|
|
22
|
+
export type CallMethodPayload = Parameters<CallMethodUnion>[0];
|
|
23
|
+
export type CallMethodResponse<M extends keyof CallApi> = UnwrappedResponse<ReturnType<CallApi[M]>>;
|
|
24
|
+
export type CallMethodAnyResponse = ReturnType<CallMethodUnion>;
|
|
25
|
+
export type CallMethod = (params: CallMethodPayload) => Promise<any>;
|
|
26
26
|
export interface IFrameCallMessage {
|
|
27
27
|
event: typeof IFRAME.CALL;
|
|
28
28
|
type: typeof IFRAME.CALL;
|
package/lib/events/core.d.ts
CHANGED
|
@@ -8,11 +8,12 @@ import type { UiEventMessage } from './ui-request';
|
|
|
8
8
|
import type { UiResponseMessage } from './ui-response';
|
|
9
9
|
import type { Unsuccessful } from '../types/params';
|
|
10
10
|
export declare const CORE_EVENT = "CORE_EVENT";
|
|
11
|
-
export
|
|
11
|
+
export type CoreMessage = {
|
|
12
12
|
id?: number;
|
|
13
13
|
success?: boolean;
|
|
14
14
|
} & (BlockchainEventMessage | DeviceEventMessage | TransportEventMessage | UiEventMessage | UiResponseMessage | IFrameCallMessage | MethodResponseMessage | IFrameEventMessage | PopupEventMessage);
|
|
15
|
-
export
|
|
15
|
+
export type PostMessageEvent = MessageEvent<CoreMessage>;
|
|
16
|
+
export type PostMessage = (message: CoreMessage) => void;
|
|
16
17
|
export declare const parseMessage: (messageData: any) => CoreMessage;
|
|
17
18
|
export declare const createErrorMessage: (error: Error & {
|
|
18
19
|
code?: string;
|
package/lib/events/device.d.ts
CHANGED
|
@@ -28,13 +28,13 @@ export interface DeviceButtonRequest {
|
|
|
28
28
|
device: Device;
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type DeviceEvent = {
|
|
32
32
|
type: typeof DEVICE.CONNECT | typeof DEVICE.CONNECT_UNACQUIRED | typeof DEVICE.CHANGED | typeof DEVICE.DISCONNECT;
|
|
33
33
|
payload: Device;
|
|
34
34
|
} | DeviceButtonRequest;
|
|
35
|
-
export
|
|
35
|
+
export type DeviceEventMessage = DeviceEvent & {
|
|
36
36
|
event: typeof DEVICE_EVENT;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type DeviceEventListenerFn = (type: typeof DEVICE_EVENT, cb: (event: DeviceEventMessage) => void) => void;
|
|
39
39
|
export declare const createDeviceMessage: MessageFactoryFn<typeof DEVICE_EVENT, DeviceEvent>;
|
|
40
40
|
//# sourceMappingURL=device.d.ts.map
|
package/lib/events/iframe.d.ts
CHANGED
|
@@ -28,11 +28,11 @@ export interface IFrameInit {
|
|
|
28
28
|
extension?: string;
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type IFrameEvent = {
|
|
32
32
|
type: typeof IFRAME.BOOTSTRAP;
|
|
33
33
|
payload?: typeof undefined;
|
|
34
34
|
} | IFrameLoaded | IFrameInit | IFrameError;
|
|
35
|
-
export
|
|
35
|
+
export type IFrameEventMessage = IFrameEvent & {
|
|
36
36
|
event: typeof UI_EVENT;
|
|
37
37
|
};
|
|
38
38
|
export declare const createIFrameMessage: MessageFactoryFn<typeof UI_EVENT, IFrameEvent>;
|
package/lib/events/popup.d.ts
CHANGED
|
@@ -40,11 +40,11 @@ export interface PopupClosedMessage {
|
|
|
40
40
|
error: any;
|
|
41
41
|
} | null;
|
|
42
42
|
}
|
|
43
|
-
export
|
|
43
|
+
export type PopupEvent = {
|
|
44
44
|
type: typeof POPUP.LOADED | typeof POPUP.CANCEL_POPUP_REQUEST;
|
|
45
45
|
payload?: typeof undefined;
|
|
46
46
|
} | PopupInit | PopupHandshake | PopupError | PopupClosedMessage;
|
|
47
|
-
export
|
|
47
|
+
export type PopupEventMessage = PopupEvent & {
|
|
48
48
|
event: typeof UI_EVENT;
|
|
49
49
|
};
|
|
50
50
|
export declare const createPopupMessage: MessageFactoryFn<typeof UI_EVENT, PopupEvent>;
|
|
@@ -38,7 +38,7 @@ export interface TransportInfo {
|
|
|
38
38
|
bridge?: BridgeInfo;
|
|
39
39
|
udev?: UdevInfo;
|
|
40
40
|
}
|
|
41
|
-
export
|
|
41
|
+
export type TransportEvent = {
|
|
42
42
|
type: typeof TRANSPORT.START;
|
|
43
43
|
payload: TransportInfo;
|
|
44
44
|
} | {
|
|
@@ -54,9 +54,9 @@ export interface TransportDisableWebUSB {
|
|
|
54
54
|
type: typeof TRANSPORT.DISABLE_WEBUSB;
|
|
55
55
|
payload?: undefined;
|
|
56
56
|
}
|
|
57
|
-
export
|
|
57
|
+
export type TransportEventMessage = TransportEvent & {
|
|
58
58
|
event: typeof TRANSPORT_EVENT;
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type TransportEventListenerFn = (type: typeof TRANSPORT_EVENT, cb: (event: TransportEventMessage) => void) => void;
|
|
61
61
|
export declare const createTransportMessage: MessageFactoryFn<typeof TRANSPORT_EVENT, TransportEvent>;
|
|
62
62
|
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -2,11 +2,11 @@ import type { DEVICE } from './device';
|
|
|
2
2
|
import type { Device } from '../device/Device';
|
|
3
3
|
import type { UiResponseEvent } from './ui-response';
|
|
4
4
|
import type { Deferred } from '../utils/deferred';
|
|
5
|
-
export
|
|
5
|
+
export type UiPromiseResponse = UiResponseEvent | {
|
|
6
6
|
type: typeof DEVICE.DISCONNECT;
|
|
7
7
|
payload?: undefined;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type UiPromise<T extends UiPromiseResponse['type']> = Deferred<Extract<UiPromiseResponse, {
|
|
10
10
|
type: T;
|
|
11
11
|
}>, T, Device>;
|
|
12
12
|
//# sourceMappingURL=ui-promise.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EventTypeDeviceSelected } from '@trezor/connect-analytics';
|
|
1
2
|
import type { PROTO } from '../constants';
|
|
2
3
|
import type { TransportDisableWebUSB } from './transport';
|
|
3
4
|
import type { Device, CoinInfo, BitcoinNetworkInfo } from '../types';
|
|
@@ -43,7 +44,7 @@ export declare const UI_REQUEST: {
|
|
|
43
44
|
readonly ADDRESS_VALIDATION: "ui-address_validation";
|
|
44
45
|
readonly IFRAME_FAILURE: "ui-iframe_failure";
|
|
45
46
|
};
|
|
46
|
-
export
|
|
47
|
+
export type UiRequestWithoutPayload = {
|
|
47
48
|
type: typeof UI_REQUEST.LOADING;
|
|
48
49
|
payload?: typeof undefined;
|
|
49
50
|
} | {
|
|
@@ -65,7 +66,7 @@ export declare type UiRequestWithoutPayload = {
|
|
|
65
66
|
type: typeof UI_REQUEST.LOGIN_CHALLENGE_REQUEST;
|
|
66
67
|
payload?: typeof undefined;
|
|
67
68
|
};
|
|
68
|
-
export
|
|
69
|
+
export type UiRequestDeviceAction = {
|
|
69
70
|
type: typeof UI_REQUEST.REQUEST_PIN;
|
|
70
71
|
payload: {
|
|
71
72
|
device: Device;
|
|
@@ -141,6 +142,7 @@ export interface UiRequestConfirmation {
|
|
|
141
142
|
className: string;
|
|
142
143
|
label: string;
|
|
143
144
|
};
|
|
145
|
+
analytics?: EventTypeDeviceSelected;
|
|
144
146
|
};
|
|
145
147
|
}
|
|
146
148
|
export interface UiRequestSelectDevice {
|
|
@@ -198,11 +200,11 @@ export interface FirmwareProgress {
|
|
|
198
200
|
progress: number;
|
|
199
201
|
};
|
|
200
202
|
}
|
|
201
|
-
export
|
|
202
|
-
export
|
|
203
|
+
export type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPermission | UiRequestConfirmation | UiRequestSelectDevice | UiRequestUnexpectedDeviceMode | UiRequestSelectAccount | UiRequestSelectFee | UpdateCustomFee | BundleProgress<any> | FirmwareProgress | FirmwareException | UiRequestAddressValidation | UiRequestSetOperation | TransportDisableWebUSB;
|
|
204
|
+
export type UiEventMessage = UiEvent & {
|
|
203
205
|
event: typeof UI_EVENT;
|
|
204
206
|
};
|
|
205
|
-
export
|
|
206
|
-
export
|
|
207
|
+
export type ProgressEventListenerFn = <R>(type: typeof UI_REQUEST.BUNDLE_PROGRESS, cb: (event: BundleProgress<R>['payload']) => void) => void;
|
|
208
|
+
export type UiEventListenerFn = (type: typeof UI_EVENT, cb: (event: UiEventMessage) => void) => void;
|
|
207
209
|
export declare const createUiMessage: MessageFactoryFn<typeof UI_EVENT, UiEvent>;
|
|
208
210
|
//# sourceMappingURL=ui-request.d.ts.map
|
|
@@ -80,8 +80,8 @@ export interface UiResponseLoginChallenge {
|
|
|
80
80
|
challengeVisual: string;
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
export
|
|
84
|
-
export
|
|
83
|
+
export type UiResponseEvent = UiResponsePopupHandshake | UiResponsePermission | UiResponseConfirmation | UiResponseDevice | UiResponsePin | UiResponseWord | UiResponsePassphrase | UiResponsePassphraseAction | UiResponseAccount | UiResponseFee | UiResponseLoginChallenge;
|
|
84
|
+
export type UiResponseMessage = UiResponseEvent & {
|
|
85
85
|
event: typeof UI_EVENT;
|
|
86
86
|
};
|
|
87
87
|
export declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
|
package/lib/factory.js
CHANGED
|
@@ -117,6 +117,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
|
|
|
117
117
|
recoveryDevice: params => call({ ...params, method: 'recoveryDevice' }),
|
|
118
118
|
getCoinInfo: params => call({ ...params, method: 'getCoinInfo' }),
|
|
119
119
|
rebootToBootloader: params => call({ ...params, method: 'rebootToBootloader' }),
|
|
120
|
+
setBusy: params => call({ ...params, method: 'setBusy' }),
|
|
120
121
|
setProxy: params => call({ ...params, method: 'setProxy' }),
|
|
121
122
|
dispose,
|
|
122
123
|
cancel,
|
package/lib/types/account.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AccountInfo as AccountInfoBase, AccountAddresses, Utxo as AccountUtxo } from '@trezor/blockchain-link';
|
|
2
2
|
export type { AccountAddresses, Utxo as AccountUtxo, Address as AccountAddress, } from '@trezor/blockchain-link';
|
|
3
|
-
export
|
|
3
|
+
export type DiscoveryAccountType = 'p2pkh' | 'p2sh' | 'p2tr' | 'p2wpkh';
|
|
4
4
|
export interface AccountInfo extends AccountInfoBase {
|
|
5
5
|
path?: string;
|
|
6
6
|
legacyXpub?: string;
|
|
@@ -22,7 +22,7 @@ export interface FeeLevel {
|
|
|
22
22
|
feeLimit?: string;
|
|
23
23
|
feePerTx?: string;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type SelectFeeLevel = {
|
|
26
26
|
name: string;
|
|
27
27
|
fee: '0';
|
|
28
28
|
feePerByte?: undefined;
|
|
@@ -9,6 +9,7 @@ export interface AuthorizeCoinJoin {
|
|
|
9
9
|
coin?: string;
|
|
10
10
|
scriptType?: PROTO.InternalInputScriptType;
|
|
11
11
|
amountUnit?: PROTO.AmountUnit;
|
|
12
|
+
preauthorized?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare function authorizeCoinJoin(params: Params<AuthorizeCoinJoin>): Response<PROTO.Success>;
|
|
14
15
|
//# sourceMappingURL=authorizeCoinJoin.d.ts.map
|
|
@@ -9,7 +9,7 @@ export interface BinanceSDKTransaction {
|
|
|
9
9
|
placeOrder?: PROTO.BinanceOrderMsg;
|
|
10
10
|
cancelOrder?: PROTO.BinanceCancelMsg;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type BinancePreparedMessage = (PROTO.BinanceTransferMsg & {
|
|
13
13
|
type: 'BinanceTransferMsg';
|
|
14
14
|
}) | (PROTO.BinanceOrderMsg & {
|
|
15
15
|
type: 'BinanceOrderMsg';
|
|
@@ -7,7 +7,7 @@ export interface SignMessage {
|
|
|
7
7
|
hex?: boolean;
|
|
8
8
|
no_script_type?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export type RefTransaction = {
|
|
11
11
|
hash: string;
|
|
12
12
|
version: number;
|
|
13
13
|
inputs: PROTO.PrevInput[];
|
|
@@ -44,6 +44,8 @@ export interface TransactionOptions {
|
|
|
44
44
|
branch_id?: number;
|
|
45
45
|
decred_staking_ticket?: boolean;
|
|
46
46
|
amount_unit?: PROTO.AmountUnit;
|
|
47
|
+
serialize?: boolean;
|
|
48
|
+
coinjoin_request?: PROTO.CoinJoinRequest;
|
|
47
49
|
}
|
|
48
50
|
export interface SignTransaction {
|
|
49
51
|
inputs: PROTO.TxInputType[];
|
|
@@ -66,8 +68,10 @@ export interface SignTransaction {
|
|
|
66
68
|
preauthorized?: boolean;
|
|
67
69
|
amountUnit?: PROTO.AmountUnit;
|
|
68
70
|
unlockPath?: PROTO.UnlockPath;
|
|
71
|
+
serialize?: boolean;
|
|
72
|
+
coinjoinRequest?: PROTO.CoinJoinRequest;
|
|
69
73
|
}
|
|
70
|
-
export
|
|
74
|
+
export type SignedTransaction = {
|
|
71
75
|
signatures: string[];
|
|
72
76
|
serializedTx: string;
|
|
73
77
|
witnesses?: (string | undefined)[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TypedRawTransaction } from '@trezor/blockchain-link';
|
|
2
2
|
import type { CommonParamsWithCoin, Response } from '../params';
|
|
3
|
-
export
|
|
3
|
+
export type BlockchainGetTransactions = CommonParamsWithCoin & {
|
|
4
4
|
txs: string[];
|
|
5
5
|
};
|
|
6
6
|
export declare function blockchainGetTransactions(params: BlockchainGetTransactions): Response<TypedRawTransaction[]>;
|