@trezor/connect 9.0.0-beta.5 → 9.0.0
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 +27 -14
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/binanceSignTransaction.d.ts +1 -1
- package/lib/api/binanceSignTransaction.js +1 -1
- package/lib/api/bitcoin/Fees.js +1 -1
- package/lib/api/bitcoin/TransactionComposer.js +1 -1
- package/lib/api/bitcoin/enhanceSignTx.d.ts +1 -1
- package/lib/api/bitcoin/index.js +9 -9
- package/lib/api/bitcoin/refTx.d.ts +3 -3
- package/lib/api/bitcoin/signtx.d.ts +1 -1
- package/lib/api/bitcoin/signtxLegacy.d.ts +1 -1
- package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -1
- package/lib/api/cardano/cardanoCertificate.d.ts +1 -1
- package/lib/api/cardano/cardanoTokenBundle.d.ts +1 -1
- package/lib/api/cardanoGetAddress.d.ts +1 -1
- package/lib/api/cardanoGetNativeScriptHash.d.ts +1 -1
- package/lib/api/cardanoGetPublicKey.d.ts +1 -1
- package/lib/api/cardanoSignTransaction.d.ts +1 -1
- package/lib/api/common/Discovery.js +1 -1
- package/lib/api/common/paramsValidator.d.ts +1 -1
- package/lib/api/composeTransaction.d.ts +1 -1
- package/lib/api/composeTransaction.js +2 -2
- package/lib/api/eos/eosSignTx.d.ts +1 -1
- package/lib/api/eos/eosSignTx.js +1 -1
- package/lib/api/eosGetPublicKey.d.ts +1 -1
- package/lib/api/eosSignTransaction.js +1 -1
- package/lib/api/ethereum/__fixtures__/ethereumSignTypedData.js +1 -1
- package/lib/api/ethereum/ethereumSignTx.d.ts +3 -3
- package/lib/api/ethereum/ethereumSignTypedData.d.ts +1 -1
- package/lib/api/ethereum/ethereumSignTypedData.js +1 -1
- package/lib/api/ethereumSignTransaction.d.ts +1 -1
- package/lib/api/ethereumSignTransaction.js +1 -1
- package/lib/api/ethereumSignTypedData.d.ts +1 -1
- package/lib/api/firmware/calculateFirmwareHash.d.ts +1 -1
- package/lib/api/firmwareUpdate.js +1 -1
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.js +2 -4
- package/lib/api/nem/nemSignTx.d.ts +1 -1
- package/lib/api/nemSignTransaction.js +1 -1
- package/lib/api/signTransaction.d.ts +2 -2
- package/lib/api/signTransaction.js +1 -1
- package/lib/api/stellar/stellarSignTx.d.ts +1 -1
- package/lib/api/stellarSignTransaction.d.ts +1 -1
- package/lib/api/stellarSignTransaction.js +1 -1
- package/lib/api/tezos/tezosSignTx.d.ts +1 -1
- package/lib/api/tezos/tezosSignTx.js +1 -1
- package/lib/api/tezosSignTransaction.js +1 -1
- package/lib/backend/BlockchainLink.js +1 -1
- package/lib/constants/errors.d.ts +1 -2
- package/lib/constants/errors.js +0 -1
- package/lib/constants/index.js +5 -5
- package/lib/core/AbstractMethod.d.ts +0 -1
- package/lib/core/AbstractMethod.js +1 -2
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.js +1 -14
- package/lib/core/method.d.ts +1 -1
- package/lib/core/method.js +1 -1
- package/lib/data/DataManager.d.ts +2 -4
- package/lib/data/DataManager.js +4 -9
- package/lib/data/config.d.ts +1 -7
- package/lib/data/config.js +1 -9
- package/lib/data/connectSettings.d.ts +1 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/AbortController.js +1 -1
- package/lib/device/DescriptorStream.js +1 -1
- package/lib/device/Device.js +1 -1
- package/lib/device/DeviceCommands.js +2 -2
- package/lib/device/DeviceList.d.ts +1 -5
- package/lib/device/DeviceList.js +8 -34
- package/lib/events/index.d.ts +0 -2
- package/lib/events/index.js +10 -10
- package/lib/events/ui-request.d.ts +1 -9
- package/lib/events/ui-request.js +0 -1
- package/lib/events/ui-response.d.ts +1 -10
- package/lib/events/ui-response.js +0 -1
- package/lib/exports.js +3 -3
- package/lib/factory.d.ts +1 -2
- package/lib/factory.js +1 -2
- package/lib/index-browser.js +1 -2
- package/lib/index.js +2 -35
- package/lib/types/api/binance/index.d.ts +29 -0
- package/lib/types/api/{customMessage.js → binance/index.js} +1 -1
- package/lib/types/api/binanceSignTransaction.d.ts +1 -27
- package/lib/types/api/bitcoin/index.d.ts +82 -0
- package/lib/types/api/bitcoin/index.js +3 -0
- package/lib/types/api/cardano/index.d.ts +193 -0
- package/lib/types/api/cardano/index.js +3 -0
- package/lib/types/api/cardanoGetAddress.d.ts +1 -31
- package/lib/types/api/cardanoGetNativeScriptHash.d.ts +1 -18
- package/lib/types/api/cardanoGetPublicKey.d.ts +1 -12
- package/lib/types/api/cardanoSignTransaction.d.ts +1 -135
- package/lib/types/api/eos/index.d.ts +119 -0
- package/lib/types/api/eos/index.js +3 -0
- package/lib/types/api/eosGetPublicKey.d.ts +1 -10
- package/lib/types/api/eosSignTransaction.d.ts +1 -107
- package/lib/types/api/ethereum/index.d.ts +86 -0
- package/lib/types/api/ethereum/index.js +3 -0
- package/lib/types/api/ethereumSignMessage.d.ts +1 -5
- package/lib/types/api/ethereumSignTransaction.d.ts +1 -37
- package/lib/types/api/ethereumSignTypedData.d.ts +1 -37
- package/lib/types/api/ethereumVerifyMessage.d.ts +1 -6
- package/lib/types/api/index.d.ts +0 -2
- package/lib/types/api/nem/index.d.ts +90 -0
- package/lib/types/api/nem/index.js +3 -0
- package/lib/types/api/nemSignTransaction.d.ts +2 -89
- package/lib/types/api/ripple/index.d.ts +21 -0
- package/lib/types/api/ripple/index.js +3 -0
- package/lib/types/api/rippleSignTransaction.d.ts +1 -20
- package/lib/types/api/signMessage.d.ts +1 -7
- package/lib/types/api/signTransaction.d.ts +1 -67
- package/lib/types/api/stellar/index.d.ts +180 -0
- package/lib/types/api/stellar/index.js +3 -0
- package/lib/types/api/stellarSignTransaction.d.ts +1 -179
- package/lib/types/api/tezos/index.d.ts +58 -0
- package/lib/types/api/tezos/index.js +3 -0
- package/lib/types/api/tezosSignTransaction.d.ts +1 -57
- package/lib/types/api/verifyMessage.d.ts +1 -7
- package/lib/types/index.d.ts +8 -4
- package/lib/types/index.js +15 -7
- package/lib/utils/__fixtures__/accountUtils.js +1 -1
- package/lib/utils/__fixtures__/ethereumUtils.js +1 -1
- package/lib/utils/__fixtures__/formatUtils.js +1 -1
- package/lib/utils/accountUtils.d.ts +2 -2
- package/lib/utils/assets-browser.js +1 -1
- package/lib/utils/assets.js +1 -1
- package/lib/utils/browserUtils.js +1 -1
- package/lib/utils/debug.d.ts +2 -2
- package/lib/utils/deviceFeaturesUtils.d.ts +1 -1
- package/lib/utils/deviceFeaturesUtils.js +1 -1
- package/lib/utils/ethereumUtils.d.ts +1 -1
- package/lib/utils/formatUtils.js +1 -1
- package/lib/utils/hdnodeUtils.d.ts +1 -1
- package/lib/utils/pathUtils.d.ts +2 -2
- package/lib/workers/workers-browser.js +5 -5
- package/lib/workers/workers-react-native.js +4 -4
- package/lib/workers/workers.js +4 -4
- package/package.json +14 -11
- package/lib/api/customMessage.d.ts +0 -13
- package/lib/api/customMessage.js +0 -56
- package/lib/types/api/customMessage.d.ts +0 -12
package/lib/constants/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PROTO = exports.NEM = exports.CARDANO = exports.NETWORK = exports.ERRORS = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
exports.ERRORS =
|
|
6
|
-
exports.NETWORK =
|
|
7
|
-
exports.CARDANO =
|
|
8
|
-
exports.NEM =
|
|
9
|
-
exports.PROTO =
|
|
5
|
+
exports.ERRORS = tslib_1.__importStar(require("./errors"));
|
|
6
|
+
exports.NETWORK = tslib_1.__importStar(require("./network"));
|
|
7
|
+
exports.CARDANO = tslib_1.__importStar(require("./cardano"));
|
|
8
|
+
exports.NEM = tslib_1.__importStar(require("./nem"));
|
|
9
|
+
exports.PROTO = tslib_1.__importStar(require("@trezor/transport/lib/types/messages"));
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -53,7 +53,6 @@ export declare abstract class AbstractMethod<Name extends CallMethodPayload['met
|
|
|
53
53
|
checkFirmwareRange(isUsingPopup?: boolean): Promise<"ui-device_firmware_old" | "ui-device_firmware_unsupported" | "ui-device_firmware_not_compatible" | "ui-device_firmware_not_installed" | undefined>;
|
|
54
54
|
abstract init(): void;
|
|
55
55
|
abstract run(): Promise<MethodReturnType<Name>>;
|
|
56
|
-
getCustomMessages(): void;
|
|
57
56
|
dispose(): void;
|
|
58
57
|
}
|
|
59
58
|
//# sourceMappingURL=AbstractMethod.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AbstractMethod = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const storage =
|
|
5
|
+
const storage = tslib_1.__importStar(require("@trezor/connect-common/lib/storage"));
|
|
6
6
|
const DataManager_1 = require("../data/DataManager");
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
const events_1 = require("../events");
|
|
@@ -152,7 +152,6 @@ class AbstractMethod {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
getCustomMessages() { }
|
|
156
155
|
dispose() { }
|
|
157
156
|
}
|
|
158
157
|
exports.AbstractMethod = AbstractMethod;
|
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").
|
|
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)[];
|
|
11
11
|
getTransportInfo(): TransportInfo;
|
|
12
12
|
}
|
|
13
13
|
export declare const initCore: () => Core;
|
package/lib/core/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initTransport = exports.init = exports.initCore = exports.Core = exports.onCall = exports.handleMessage = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const events_1 =
|
|
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
8
|
const constants_1 = require("../constants");
|
|
@@ -57,7 +57,6 @@ const handleMessage = (message, isTrustedOrigin = false) => {
|
|
|
57
57
|
const safeMessages = [
|
|
58
58
|
events_2.IFRAME.CALL,
|
|
59
59
|
events_2.POPUP.CLOSED,
|
|
60
|
-
events_2.UI.CUSTOM_MESSAGE_RESPONSE,
|
|
61
60
|
events_2.UI.LOGIN_CHALLENGE_RESPONSE,
|
|
62
61
|
events_2.TRANSPORT.DISABLE_WEBUSB,
|
|
63
62
|
];
|
|
@@ -82,7 +81,6 @@ const handleMessage = (message, isTrustedOrigin = false) => {
|
|
|
82
81
|
case events_2.UI.INVALID_PASSPHRASE_ACTION:
|
|
83
82
|
case events_2.UI.RECEIVE_ACCOUNT:
|
|
84
83
|
case events_2.UI.RECEIVE_FEE:
|
|
85
|
-
case events_2.UI.CUSTOM_MESSAGE_RESPONSE:
|
|
86
84
|
case events_2.UI.RECEIVE_WORD:
|
|
87
85
|
case events_2.UI.LOGIN_CHALLENGE_RESPONSE: {
|
|
88
86
|
const uiPromise = findUiPromise(message.type);
|
|
@@ -255,9 +253,6 @@ const onCall = async (message) => {
|
|
|
255
253
|
device.on(events_2.DEVICE.PASSPHRASE_ON_DEVICE, () => {
|
|
256
254
|
postMessage((0, events_2.createUiMessage)(events_2.UI.REQUEST_PASSPHRASE_ON_DEVICE, { device: device.toMessageObject() }));
|
|
257
255
|
});
|
|
258
|
-
if (_deviceList) {
|
|
259
|
-
await _deviceList.reconfigure(device.getVersion());
|
|
260
|
-
}
|
|
261
256
|
try {
|
|
262
257
|
let PIN_TRIES = 1;
|
|
263
258
|
const MAX_PIN_TRIES = 3;
|
|
@@ -311,9 +306,6 @@ const onCall = async (message) => {
|
|
|
311
306
|
return Promise.reject(constants_1.ERRORS.TypedError('Method_Cancel'));
|
|
312
307
|
}
|
|
313
308
|
}
|
|
314
|
-
if (_deviceList) {
|
|
315
|
-
await _deviceList.reconfigure(device.getVersion());
|
|
316
|
-
}
|
|
317
309
|
try {
|
|
318
310
|
const invalidDeviceState = method.useDeviceState
|
|
319
311
|
? await device.validateState(method.network)
|
|
@@ -354,10 +346,6 @@ const onCall = async (message) => {
|
|
|
354
346
|
postMessage((0, events_2.createPopupMessage)(events_2.POPUP.CANCEL_POPUP_REQUEST));
|
|
355
347
|
}
|
|
356
348
|
try {
|
|
357
|
-
const customMessages = method.getCustomMessages();
|
|
358
|
-
if (_deviceList && customMessages) {
|
|
359
|
-
await _deviceList.reconfigure(customMessages, true);
|
|
360
|
-
}
|
|
361
349
|
const response = await method.run();
|
|
362
350
|
messageResponse = (0, events_2.createResponseMessage)(method.responseID, true, response);
|
|
363
351
|
}
|
|
@@ -400,7 +388,6 @@ const onCall = async (message) => {
|
|
|
400
388
|
if (response.success) {
|
|
401
389
|
_deviceList.removeAuthPenalty(device);
|
|
402
390
|
}
|
|
403
|
-
await _deviceList.restoreMessages();
|
|
404
391
|
}
|
|
405
392
|
postMessage(response);
|
|
406
393
|
}
|
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.
|
|
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;
|
|
6
6
|
//# sourceMappingURL=method.d.ts.map
|
package/lib/core/method.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMethod = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const Methods =
|
|
5
|
+
const Methods = tslib_1.__importStar(require("../api"));
|
|
6
6
|
const errors_1 = require("../constants/errors");
|
|
7
7
|
const getMethod = (message) => {
|
|
8
8
|
const { method } = message.payload;
|
|
@@ -6,11 +6,9 @@ declare type AssetCollection = {
|
|
|
6
6
|
export declare class DataManager {
|
|
7
7
|
static assets: AssetCollection;
|
|
8
8
|
static settings: ConnectSettings;
|
|
9
|
-
static messages
|
|
10
|
-
[key: string]: JSON;
|
|
11
|
-
};
|
|
9
|
+
private static messages;
|
|
12
10
|
static load(settings: ConnectSettings, withAssets?: boolean): Promise<void>;
|
|
13
|
-
static getProtobufMessages(
|
|
11
|
+
static getProtobufMessages(): JSON;
|
|
14
12
|
static isWhitelisted(origin: string): {
|
|
15
13
|
origin: string;
|
|
16
14
|
priority: number;
|
package/lib/data/DataManager.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DataManager = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const parse_uri_1 =
|
|
5
|
+
const parse_uri_1 = tslib_1.__importDefault(require("parse-uri"));
|
|
6
6
|
const assets_1 = require("../utils/assets");
|
|
7
7
|
const connectSettings_1 = require("./connectSettings");
|
|
8
8
|
const coinInfo_1 = require("./coinInfo");
|
|
@@ -40,18 +40,14 @@ class DataManager {
|
|
|
40
40
|
this.assets[asset.name] = json;
|
|
41
41
|
});
|
|
42
42
|
await Promise.all(assetPromises);
|
|
43
|
-
|
|
44
|
-
const json = await (0, assets_1.httpRequest)(`${protobuf.json}${ts}`, 'json');
|
|
45
|
-
this.messages[protobuf.name] = json;
|
|
46
|
-
});
|
|
47
|
-
await Promise.all(protobufPromises);
|
|
43
|
+
this.messages = await (0, assets_1.httpRequest)(`${config_1.config.messages}${ts}`, 'json');
|
|
48
44
|
(0, transportInfo_1.parseBridgeJSON)(this.assets.bridge);
|
|
49
45
|
(0, coinInfo_1.parseCoinsJson)(this.assets.coins);
|
|
50
46
|
(0, firmwareInfo_1.parseFirmware)(this.assets['firmware-t1'], 1);
|
|
51
47
|
(0, firmwareInfo_1.parseFirmware)(this.assets['firmware-t2'], 2);
|
|
52
48
|
}
|
|
53
|
-
static getProtobufMessages(
|
|
54
|
-
return this.messages
|
|
49
|
+
static getProtobufMessages() {
|
|
50
|
+
return this.messages;
|
|
55
51
|
}
|
|
56
52
|
static isWhitelisted(origin) {
|
|
57
53
|
const uri = (0, parse_uri_1.default)(origin);
|
|
@@ -94,5 +90,4 @@ class DataManager {
|
|
|
94
90
|
}
|
|
95
91
|
exports.DataManager = DataManager;
|
|
96
92
|
DataManager.assets = {};
|
|
97
|
-
DataManager.messages = {};
|
|
98
93
|
//# sourceMappingURL=DataManager.js.map
|
package/lib/data/config.d.ts
CHANGED
package/lib/data/config.js
CHANGED
|
@@ -63,15 +63,7 @@ exports.config = {
|
|
|
63
63
|
url: './data/firmware/2/releases.json',
|
|
64
64
|
},
|
|
65
65
|
],
|
|
66
|
-
messages:
|
|
67
|
-
{
|
|
68
|
-
name: 'default',
|
|
69
|
-
range: {
|
|
70
|
-
min: ['1.0.0', '2.0.0'],
|
|
71
|
-
},
|
|
72
|
-
json: './data/messages/messages.json',
|
|
73
|
-
},
|
|
74
|
-
],
|
|
66
|
+
messages: './data/messages/messages.json',
|
|
75
67
|
supportedBrowsers: {
|
|
76
68
|
chrome: {
|
|
77
69
|
version: 59,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConnectSettings } from '../types';
|
|
2
2
|
export declare const DEFAULT_PRIORITY = 2;
|
|
3
3
|
export declare const getEnv: () => "web" | "webextension" | "electron" | "react-native";
|
|
4
|
-
export declare const corsValidator: (url?: string
|
|
4
|
+
export declare const corsValidator: (url?: string) => string | undefined;
|
|
5
5
|
export declare const parseConnectSettings: (input?: Partial<ConnectSettings>) => ConnectSettings;
|
|
6
6
|
//# sourceMappingURL=connectSettings.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.0
|
|
4
|
+
exports.VERSION = '9.0.0';
|
|
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
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAbortController = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const events_1 =
|
|
5
|
+
const events_1 = tslib_1.__importDefault(require("events"));
|
|
6
6
|
class AbortSignal {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.aborted = false;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DescriptorStream = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const events_1 =
|
|
5
|
+
const events_1 = tslib_1.__importDefault(require("events"));
|
|
6
6
|
const transport_1 = require("../events/transport");
|
|
7
7
|
const device_1 = require("../events/device");
|
|
8
8
|
const debug_1 = require("../utils/debug");
|
package/lib/device/Device.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Device = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const events_1 =
|
|
5
|
+
const events_1 = tslib_1.__importDefault(require("events"));
|
|
6
6
|
const DeviceCommands_1 = require("./DeviceCommands");
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
const events_2 = require("../events");
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeviceCommands = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const randombytes_1 =
|
|
5
|
+
const randombytes_1 = tslib_1.__importDefault(require("randombytes"));
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
7
|
const events_1 = require("../events");
|
|
8
|
-
const hdnodeUtils =
|
|
8
|
+
const hdnodeUtils = tslib_1.__importStar(require("../utils/hdnodeUtils"));
|
|
9
9
|
const pathUtils_1 = require("../utils/pathUtils");
|
|
10
10
|
const accountUtils_1 = require("../utils/accountUtils");
|
|
11
11
|
const versionUtils_1 = require("../utils/versionUtils");
|
|
@@ -39,9 +39,7 @@ export declare class DeviceList extends EventEmitter {
|
|
|
39
39
|
creatingDevicesDescriptors: {
|
|
40
40
|
[k: string]: DeviceDescriptor;
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
currentMessages: JSON | Record<string, any>;
|
|
44
|
-
hasCustomMessages: boolean;
|
|
42
|
+
messages: JSON | Record<string, any>;
|
|
45
43
|
transportStartPending: number;
|
|
46
44
|
penalizedDevices: {
|
|
47
45
|
[deviceID: string]: number;
|
|
@@ -49,8 +47,6 @@ export declare class DeviceList extends EventEmitter {
|
|
|
49
47
|
fetchController?: Controller | null;
|
|
50
48
|
constructor();
|
|
51
49
|
init(): Promise<void>;
|
|
52
|
-
reconfigure(messages: JSON | Record<string, any> | number[], custom?: boolean): Promise<void>;
|
|
53
|
-
restoreMessages(): Promise<void>;
|
|
54
50
|
resolveTransportEvent(): void;
|
|
55
51
|
waitForTransportFirstEvent(): Promise<void>;
|
|
56
52
|
_initStream(): void;
|
package/lib/device/DeviceList.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDeviceList = exports.DeviceList = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const events_1 =
|
|
6
|
-
const transport_1 =
|
|
7
|
-
const cross_fetch_1 =
|
|
5
|
+
const events_1 = tslib_1.__importDefault(require("events"));
|
|
6
|
+
const transport_1 = tslib_1.__importDefault(require("@trezor/transport"));
|
|
7
|
+
const cross_fetch_1 = tslib_1.__importDefault(require("cross-fetch"));
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
9
|
const events_2 = require("../events");
|
|
10
10
|
const DescriptorStream_1 = require("./DescriptorStream");
|
|
@@ -19,10 +19,10 @@ const { BridgeV2, Fallback } = transport_1.default;
|
|
|
19
19
|
const _log = (0, debug_1.initLog)('DeviceList');
|
|
20
20
|
class DeviceList extends events_1.default {
|
|
21
21
|
constructor() {
|
|
22
|
+
var _a;
|
|
22
23
|
super();
|
|
23
24
|
this.devices = {};
|
|
24
25
|
this.creatingDevicesDescriptors = {};
|
|
25
|
-
this.hasCustomMessages = false;
|
|
26
26
|
this.transportStartPending = 0;
|
|
27
27
|
this.penalizedDevices = {};
|
|
28
28
|
const { env, webusb } = DataManager_1.DataManager.settings;
|
|
@@ -37,15 +37,15 @@ class DeviceList extends events_1.default {
|
|
|
37
37
|
this.fetchController = (0, AbortController_1.getAbortController)();
|
|
38
38
|
const { signal } = this.fetchController;
|
|
39
39
|
const fetchWithSignal = (args, options = {}) => (0, cross_fetch_1.default)(args, { ...options, signal });
|
|
40
|
-
|
|
40
|
+
const isNode = !!((_a = process === null || process === void 0 ? void 0 : process.release) === null || _a === void 0 ? void 0 : _a.name) && process.release.name.search(/node|io\.js/) !== -1;
|
|
41
|
+
BridgeV2.setFetch(fetchWithSignal, isNode);
|
|
41
42
|
transports.push(bridge);
|
|
42
43
|
}
|
|
43
44
|
if (webusb && typeof workers_1.WebUsbPlugin !== 'undefined') {
|
|
44
45
|
transports.push((0, workers_1.WebUsbPlugin)());
|
|
45
46
|
}
|
|
46
47
|
this.transport = new Fallback(transports);
|
|
47
|
-
this.
|
|
48
|
-
this.currentMessages = this.defaultMessages;
|
|
48
|
+
this.messages = DataManager_1.DataManager.getProtobufMessages();
|
|
49
49
|
}
|
|
50
50
|
async init() {
|
|
51
51
|
const { transport } = this;
|
|
@@ -53,7 +53,7 @@ class DeviceList extends events_1.default {
|
|
|
53
53
|
_log.debug('Initializing transports');
|
|
54
54
|
await transport.init(_log.enabled);
|
|
55
55
|
_log.debug('Configuring transports');
|
|
56
|
-
await transport.configure(JSON.stringify(this.
|
|
56
|
+
await transport.configure(JSON.stringify(this.messages));
|
|
57
57
|
_log.debug('Configuring transports done');
|
|
58
58
|
const { activeName } = transport;
|
|
59
59
|
if (activeName === 'LowlevelTransportWithSharedConnections') {
|
|
@@ -67,32 +67,6 @@ class DeviceList extends events_1.default {
|
|
|
67
67
|
this.emit(events_2.TRANSPORT.ERROR, error);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
async reconfigure(messages, custom) {
|
|
71
|
-
if (Array.isArray(messages)) {
|
|
72
|
-
messages = DataManager_1.DataManager.getProtobufMessages(messages);
|
|
73
|
-
}
|
|
74
|
-
if (this.currentMessages === messages || !messages)
|
|
75
|
-
return;
|
|
76
|
-
try {
|
|
77
|
-
await this.transport.configure(JSON.stringify(messages));
|
|
78
|
-
this.currentMessages = messages;
|
|
79
|
-
this.hasCustomMessages = typeof custom === 'boolean' ? custom : false;
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
throw constants_1.ERRORS.TypedError('Transport_InvalidProtobuf', error.message);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
async restoreMessages() {
|
|
86
|
-
if (!this.hasCustomMessages)
|
|
87
|
-
return;
|
|
88
|
-
try {
|
|
89
|
-
await this.transport.configure(JSON.stringify(this.defaultMessages));
|
|
90
|
-
this.hasCustomMessages = false;
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
throw constants_1.ERRORS.TypedError('Transport_InvalidProtobuf', error.message);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
70
|
resolveTransportEvent() {
|
|
97
71
|
this.transportStartPending--;
|
|
98
72
|
if (this.transportStartPending === 0) {
|
package/lib/events/index.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ export declare const UI: {
|
|
|
19
19
|
readonly RECEIVE_WORD: "ui-receive_word";
|
|
20
20
|
readonly INVALID_PASSPHRASE_ACTION: "ui-invalid_passphrase_action";
|
|
21
21
|
readonly CHANGE_SETTINGS: "ui-change_settings";
|
|
22
|
-
readonly CUSTOM_MESSAGE_RESPONSE: "ui-custom_response";
|
|
23
22
|
readonly LOGIN_CHALLENGE_RESPONSE: "ui-login_challenge_response";
|
|
24
23
|
readonly TRANSPORT: "ui-no_transport";
|
|
25
24
|
readonly BOOTLOADER: "ui-device_bootloader_mode";
|
|
@@ -54,7 +53,6 @@ export declare const UI: {
|
|
|
54
53
|
readonly REQUEST_BUTTON: "ui-button";
|
|
55
54
|
readonly REQUEST_WORD: "ui-request_word";
|
|
56
55
|
readonly LOGIN_CHALLENGE_REQUEST: "ui-login_challenge_request";
|
|
57
|
-
readonly CUSTOM_MESSAGE_REQUEST: "ui-custom_request";
|
|
58
56
|
readonly BUNDLE_PROGRESS: "ui-bundle_progress";
|
|
59
57
|
readonly ADDRESS_VALIDATION: "ui-address_validation";
|
|
60
58
|
readonly IFRAME_FAILURE: "ui-iframe_failure";
|
package/lib/events/index.js
CHANGED
|
@@ -4,16 +4,16 @@ exports.UI = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ui_request_1 = require("./ui-request");
|
|
6
6
|
const ui_response_1 = require("./ui-response");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
tslib_1.__exportStar(require("./blockchain"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./call"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./core"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./device"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./iframe"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./popup"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./transport"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./ui-promise"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./ui-request"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./ui-response"), exports);
|
|
17
17
|
exports.UI = {
|
|
18
18
|
...ui_request_1.UI_REQUEST,
|
|
19
19
|
...ui_response_1.UI_RESPONSE,
|
|
@@ -39,7 +39,6 @@ export declare const UI_REQUEST: {
|
|
|
39
39
|
readonly REQUEST_BUTTON: "ui-button";
|
|
40
40
|
readonly REQUEST_WORD: "ui-request_word";
|
|
41
41
|
readonly LOGIN_CHALLENGE_REQUEST: "ui-login_challenge_request";
|
|
42
|
-
readonly CUSTOM_MESSAGE_REQUEST: "ui-custom_request";
|
|
43
42
|
readonly BUNDLE_PROGRESS: "ui-bundle_progress";
|
|
44
43
|
readonly ADDRESS_VALIDATION: "ui-address_validation";
|
|
45
44
|
readonly IFRAME_FAILURE: "ui-iframe_failure";
|
|
@@ -163,14 +162,7 @@ export interface FirmwareProgress {
|
|
|
163
162
|
progress: number;
|
|
164
163
|
};
|
|
165
164
|
}
|
|
166
|
-
export
|
|
167
|
-
type: typeof UI_REQUEST.CUSTOM_MESSAGE_REQUEST;
|
|
168
|
-
payload: {
|
|
169
|
-
type: string;
|
|
170
|
-
message: object;
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
export declare type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPermission | UiRequestConfirmation | UiRequestSelectDevice | UiRequestUnexpectedDeviceMode | UiRequestSelectAccount | UiRequestSelectFee | UpdateCustomFee | BundleProgress<any> | FirmwareProgress | FirmwareException | UiRequestAddressValidation | UiRequestCustomMessage | UiRequestSetOperation | TransportDisableWebUSB;
|
|
165
|
+
export declare type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPermission | UiRequestConfirmation | UiRequestSelectDevice | UiRequestUnexpectedDeviceMode | UiRequestSelectAccount | UiRequestSelectFee | UpdateCustomFee | BundleProgress<any> | FirmwareProgress | FirmwareException | UiRequestAddressValidation | UiRequestSetOperation | TransportDisableWebUSB;
|
|
174
166
|
export declare type UiEventMessage = UiEvent & {
|
|
175
167
|
event: typeof UI_EVENT;
|
|
176
168
|
};
|
package/lib/events/ui-request.js
CHANGED
|
@@ -36,7 +36,6 @@ exports.UI_REQUEST = {
|
|
|
36
36
|
REQUEST_BUTTON: 'ui-button',
|
|
37
37
|
REQUEST_WORD: 'ui-request_word',
|
|
38
38
|
LOGIN_CHALLENGE_REQUEST: 'ui-login_challenge_request',
|
|
39
|
-
CUSTOM_MESSAGE_REQUEST: 'ui-custom_request',
|
|
40
39
|
BUNDLE_PROGRESS: 'ui-bundle_progress',
|
|
41
40
|
ADDRESS_VALIDATION: 'ui-address_validation',
|
|
42
41
|
IFRAME_FAILURE: 'ui-iframe_failure',
|
|
@@ -13,7 +13,6 @@ export declare const UI_RESPONSE: {
|
|
|
13
13
|
readonly RECEIVE_WORD: "ui-receive_word";
|
|
14
14
|
readonly INVALID_PASSPHRASE_ACTION: "ui-invalid_passphrase_action";
|
|
15
15
|
readonly CHANGE_SETTINGS: "ui-change_settings";
|
|
16
|
-
readonly CUSTOM_MESSAGE_RESPONSE: "ui-custom_response";
|
|
17
16
|
readonly LOGIN_CHALLENGE_RESPONSE: "ui-login_challenge_response";
|
|
18
17
|
};
|
|
19
18
|
export interface UiResponsePopupHandshake {
|
|
@@ -74,14 +73,6 @@ export interface UiResponseFee {
|
|
|
74
73
|
value: string;
|
|
75
74
|
};
|
|
76
75
|
}
|
|
77
|
-
export interface UiResponseCustomMessage {
|
|
78
|
-
type: typeof UI_RESPONSE.CUSTOM_MESSAGE_RESPONSE;
|
|
79
|
-
payload: {
|
|
80
|
-
type: string;
|
|
81
|
-
message: any;
|
|
82
|
-
params?: any;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
76
|
export interface UiResponseLoginChallenge {
|
|
86
77
|
type: typeof UI_RESPONSE.LOGIN_CHALLENGE_RESPONSE;
|
|
87
78
|
payload: {
|
|
@@ -89,7 +80,7 @@ export interface UiResponseLoginChallenge {
|
|
|
89
80
|
challengeVisual: string;
|
|
90
81
|
};
|
|
91
82
|
}
|
|
92
|
-
export declare type UiResponseEvent = UiResponsePopupHandshake | UiResponsePermission | UiResponseConfirmation | UiResponseDevice | UiResponsePin | UiResponseWord | UiResponsePassphrase | UiResponsePassphraseAction | UiResponseAccount | UiResponseFee | UiResponseLoginChallenge
|
|
83
|
+
export declare type UiResponseEvent = UiResponsePopupHandshake | UiResponsePermission | UiResponseConfirmation | UiResponseDevice | UiResponsePin | UiResponseWord | UiResponsePassphrase | UiResponsePassphraseAction | UiResponseAccount | UiResponseFee | UiResponseLoginChallenge;
|
|
93
84
|
export declare type UiResponseMessage = UiResponseEvent & {
|
|
94
85
|
event: typeof UI_EVENT;
|
|
95
86
|
};
|
|
@@ -13,7 +13,6 @@ exports.UI_RESPONSE = {
|
|
|
13
13
|
RECEIVE_WORD: 'ui-receive_word',
|
|
14
14
|
INVALID_PASSPHRASE_ACTION: 'ui-invalid_passphrase_action',
|
|
15
15
|
CHANGE_SETTINGS: 'ui-change_settings',
|
|
16
|
-
CUSTOM_MESSAGE_RESPONSE: 'ui-custom_response',
|
|
17
16
|
LOGIN_CHALLENGE_RESPONSE: 'ui-login_challenge_response',
|
|
18
17
|
};
|
|
19
18
|
const createUiResponse = (type, payload) => ({
|
package/lib/exports.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseConnectSettings = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
tslib_1.__exportStar(require("./constants"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./events"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
8
8
|
var connectSettings_1 = require("./data/connectSettings");
|
|
9
9
|
Object.defineProperty(exports, "parseConnectSettings", { enumerable: true, get: function () { return connectSettings_1.parseConnectSettings; } });
|
|
10
10
|
//# sourceMappingURL=exports.js.map
|
package/lib/factory.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ interface Dependencies {
|
|
|
7
7
|
eventEmitter: EventEmitter;
|
|
8
8
|
manifest: TrezorConnect['manifest'];
|
|
9
9
|
init: TrezorConnect['init'];
|
|
10
|
-
customMessage: TrezorConnect['customMessage'];
|
|
11
10
|
requestLogin: TrezorConnect['requestLogin'];
|
|
12
11
|
uiResponse: TrezorConnect['uiResponse'];
|
|
13
12
|
renderWebUSBButton: TrezorConnect['renderWebUSBButton'];
|
|
@@ -15,6 +14,6 @@ interface Dependencies {
|
|
|
15
14
|
cancel: TrezorConnect['cancel'];
|
|
16
15
|
dispose: TrezorConnect['dispose'];
|
|
17
16
|
}
|
|
18
|
-
export declare const factory: ({ eventEmitter, manifest, init, call,
|
|
17
|
+
export declare const factory: ({ eventEmitter, manifest, init, call, requestLogin, uiResponse, renderWebUSBButton, disableWebUSB, cancel, dispose, }: Dependencies) => TrezorConnect;
|
|
19
18
|
export {};
|
|
20
19
|
//# sourceMappingURL=factory.d.ts.map
|
package/lib/factory.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.factory = void 0;
|
|
4
4
|
const events_1 = require("./events");
|
|
5
|
-
const factory = ({ eventEmitter, manifest, init, call,
|
|
5
|
+
const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse, renderWebUSBButton, disableWebUSB, cancel, dispose, }) => {
|
|
6
6
|
const api = {
|
|
7
7
|
manifest,
|
|
8
8
|
init,
|
|
@@ -33,7 +33,6 @@ const factory = ({ eventEmitter, manifest, init, call, customMessage, requestLog
|
|
|
33
33
|
blockchainSubscribeFiatRates: params => call({ ...params, method: 'blockchainSubscribeFiatRates' }),
|
|
34
34
|
blockchainUnsubscribe: params => call({ ...params, method: 'blockchainUnsubscribe' }),
|
|
35
35
|
blockchainUnsubscribeFiatRates: params => call({ ...params, method: 'blockchainUnsubscribeFiatRates' }),
|
|
36
|
-
customMessage: params => customMessage(params),
|
|
37
36
|
requestLogin: params => requestLogin(params),
|
|
38
37
|
cardanoGetAddress: params => call({
|
|
39
38
|
...params,
|
package/lib/index-browser.js
CHANGED
|
@@ -16,7 +16,6 @@ const TrezorConnect = (0, factory_1.factory)({
|
|
|
16
16
|
manifest: fallback,
|
|
17
17
|
init: fallback,
|
|
18
18
|
call: fallback,
|
|
19
|
-
customMessage: fallback,
|
|
20
19
|
requestLogin: fallback,
|
|
21
20
|
uiResponse: fallback,
|
|
22
21
|
renderWebUSBButton: fallback,
|
|
@@ -25,5 +24,5 @@ const TrezorConnect = (0, factory_1.factory)({
|
|
|
25
24
|
dispose: fallback,
|
|
26
25
|
});
|
|
27
26
|
exports.default = TrezorConnect;
|
|
28
|
-
|
|
27
|
+
tslib_1.__exportStar(require("./exports"), exports);
|
|
29
28
|
//# sourceMappingURL=index-browser.js.map
|