@trezor/connect 9.5.3 → 9.5.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -6
- package/README.md +1 -1
- package/lib/api/binance/api/binanceSignTransaction.js +1 -1
- package/lib/api/bitcoin/BitcoinFees.d.ts +4 -6
- package/lib/api/bitcoin/BitcoinFees.js +8 -2
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/bitcoin/signtxVerify.js +3 -3
- package/lib/api/blockchainEstimateFee.js +13 -13
- package/lib/api/cardano/api/cardanoSignTransaction.js +1 -1
- package/lib/api/common/Discovery.d.ts +4 -4
- package/lib/api/common/Discovery.js +3 -4
- package/lib/api/common/MiscFees.d.ts +5 -9
- package/lib/api/common/MiscFees.js +6 -21
- package/lib/api/composeTransaction.js +4 -3
- package/lib/api/eos/api/eosSignTransaction.js +1 -1
- package/lib/api/eos/eosSignTx.d.ts +2 -2
- package/lib/api/ethereum/EthereumFees.d.ts +5 -8
- package/lib/api/ethereum/EthereumFees.js +24 -38
- package/lib/api/ethereum/api/ethereumGetAddress.d.ts +1 -5
- package/lib/api/ethereum/api/ethereumGetAddress.js +7 -8
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +11 -7
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +12 -5
- package/lib/api/ethereum/api/ethereumSignTransaction.js +2 -2
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +2 -4
- package/lib/api/ethereum/api/ethereumSignTypedData.js +1 -1
- package/lib/api/firmware/uploadFirmware.d.ts +2 -2
- package/lib/api/getAccountDescriptor.js +1 -3
- package/lib/api/getAccountInfo.js +4 -9
- package/lib/api/getAddress.js +6 -7
- package/lib/api/getCoinInfo.d.ts +12 -18
- package/lib/api/getPublicKey.d.ts +11 -7
- package/lib/api/resetDevice.js +1 -3
- package/lib/api/signTransaction.js +3 -3
- package/lib/api/stellar/api/stellarSignTransaction.js +1 -1
- package/lib/constants/errors.d.ts +1 -2
- package/lib/constants/errors.js +8 -3
- package/lib/core/index.js +36 -15
- package/lib/core/onCallFirmwareUpdate.js +6 -3
- package/lib/data/coinInfo.d.ts +44 -66
- package/lib/data/config.d.ts +10 -0
- package/lib/data/config.js +10 -0
- package/lib/data/deviceAuthenticityConfig.js +4 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +82 -16
- package/lib/device/Device.js +51 -61
- package/lib/device/DeviceCommands.d.ts +37 -4549
- package/lib/device/DeviceCommands.js +55 -264
- package/lib/device/DeviceCurrentSession.d.ts +4531 -0
- package/lib/device/DeviceCurrentSession.js +209 -0
- package/lib/device/DeviceList.js +4 -6
- package/lib/device/TransportManager.d.ts +1 -1
- package/lib/device/TransportManager.js +5 -4
- package/lib/events/ui-response.d.ts +3 -3
- package/lib/impl/dynamic.d.ts +4 -1
- package/lib/impl/dynamic.js +17 -4
- package/lib/tsconfig.lib.tsbuildinfo +1 -1
- package/lib/types/api/getPublicKey.d.ts +5 -3
- package/lib/types/api/getPublicKey.js +13 -12
- package/lib/types/coinInfo.d.ts +12 -24
- package/lib/types/fees.d.ts +2 -11
- package/lib/types/fees.js +3 -11
- package/lib/utils/versionCheck.js +1 -1
- package/package.json +7 -7
- package/lib/device/prompts.d.ts +0 -866
- package/lib/device/prompts.js +0 -60
package/lib/device/prompts.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.promptWord = exports.promptPin = exports.promptPassphrase = exports.cancelPrompt = void 0;
|
|
4
|
-
const transport_1 = require("@trezor/transport");
|
|
5
|
-
const events_1 = require("../events");
|
|
6
|
-
const cancelPrompt = (device, expectResponse = true) => {
|
|
7
|
-
const session = device.getLocalSession();
|
|
8
|
-
if (!session) {
|
|
9
|
-
return Promise.resolve({
|
|
10
|
-
success: false,
|
|
11
|
-
error: transport_1.TRANSPORT_ERROR.SESSION_NOT_FOUND,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
const cancelArgs = {
|
|
15
|
-
session,
|
|
16
|
-
name: 'Cancel',
|
|
17
|
-
data: {},
|
|
18
|
-
protocol: device.protocol,
|
|
19
|
-
};
|
|
20
|
-
return expectResponse ? device.transport.call(cancelArgs) : device.transport.send(cancelArgs);
|
|
21
|
-
};
|
|
22
|
-
exports.cancelPrompt = cancelPrompt;
|
|
23
|
-
const extractMessage = (payload) => (payload && 'message' in payload.message && payload.message.message) || '';
|
|
24
|
-
const prompt = (event, { device, ...rest }) => new Promise(resolve => {
|
|
25
|
-
const cancelAndReject = (error) => (0, exports.cancelPrompt)(device).then(response => response.success
|
|
26
|
-
? resolve({
|
|
27
|
-
success: false,
|
|
28
|
-
error: error || extractMessage(response.payload),
|
|
29
|
-
message: extractMessage(response.payload),
|
|
30
|
-
isTransportError: !response.success,
|
|
31
|
-
})
|
|
32
|
-
: resolve({
|
|
33
|
-
success: false,
|
|
34
|
-
error: response.error,
|
|
35
|
-
isTransportError: true,
|
|
36
|
-
}));
|
|
37
|
-
if (device.listenerCount(event) > 0) {
|
|
38
|
-
device.setCancelableAction(cancelAndReject);
|
|
39
|
-
const callback = (...[response, error]) => {
|
|
40
|
-
device.clearCancelableAction();
|
|
41
|
-
if (error || response == null) {
|
|
42
|
-
cancelAndReject(error);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
resolve({ success: true, payload: response });
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
device.emit(event, { device, callback, ...rest });
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
cancelAndReject(`${event} callback not configured`);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const promptPassphrase = (device) => prompt(events_1.DEVICE.PASSPHRASE, { device });
|
|
55
|
-
exports.promptPassphrase = promptPassphrase;
|
|
56
|
-
const promptPin = (device, type) => prompt(events_1.DEVICE.PIN, { device, type });
|
|
57
|
-
exports.promptPin = promptPin;
|
|
58
|
-
const promptWord = (device, type) => prompt(events_1.DEVICE.WORD, { device, type });
|
|
59
|
-
exports.promptWord = promptWord;
|
|
60
|
-
//# sourceMappingURL=prompts.js.map
|