@trezor/connect 9.1.5 → 9.1.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 +66 -0
- package/README.md +1 -1
- package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +4 -4
- package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +10 -7
- package/lib/api/{binanceGetPublicKey.d.ts → binance/api/binanceGetPublicKey.d.ts} +3 -3
- package/lib/api/{binanceGetPublicKey.js → binance/api/binanceGetPublicKey.js} +5 -5
- package/lib/api/{binanceSignTransaction.d.ts → binance/api/binanceSignTransaction.d.ts} +3 -2
- package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +8 -6
- package/lib/api/binance/api/index.d.ts +4 -0
- package/lib/api/binance/api/index.js +13 -0
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/binance/binanceSignTx.js +2 -1
- package/lib/api/bitcoin/TransactionComposer.d.ts +4 -4
- package/lib/api/bitcoin/TransactionComposer.js +4 -18
- package/lib/api/bitcoin/inputs.d.ts +2 -2
- package/lib/api/bitcoin/inputs.js +4 -5
- package/lib/api/bitcoin/outputs.d.ts +4 -4
- package/lib/api/bitcoin/outputs.js +14 -23
- package/lib/api/blockchainEstimateFee.d.ts +2 -2
- package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +8 -0
- package/lib/api/cardano/api/cardanoComposeTransaction.js +69 -0
- package/lib/api/{cardanoGetAddress.d.ts → cardano/api/cardanoGetAddress.d.ts} +4 -4
- package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +11 -8
- package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts} +3 -3
- package/lib/api/{cardanoGetNativeScriptHash.js → cardano/api/cardanoGetNativeScriptHash.js} +5 -5
- package/lib/api/{cardanoGetPublicKey.d.ts → cardano/api/cardanoGetPublicKey.d.ts} +3 -3
- package/lib/api/{cardanoGetPublicKey.js → cardano/api/cardanoGetPublicKey.js} +6 -6
- package/lib/api/{cardanoSignTransaction.d.ts → cardano/api/cardanoSignTransaction.d.ts} +19 -8
- package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +33 -13
- package/lib/api/cardano/api/index.d.ts +6 -0
- package/lib/api/cardano/api/index.js +17 -0
- package/lib/api/cardano/cardanoUtils.d.ts +6 -0
- package/lib/api/cardano/cardanoUtils.js +64 -1
- package/lib/api/common/paramsValidator.js +5 -3
- package/lib/api/composeTransaction.d.ts +5 -5
- package/lib/api/composeTransaction.js +14 -19
- package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
- package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +7 -5
- package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +3 -2
- package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +8 -6
- package/lib/api/eos/api/index.d.ts +3 -0
- package/lib/api/eos/api/index.js +11 -0
- package/lib/api/eos/eosSignTx.d.ts +1 -1
- package/lib/api/eos/eosSignTx.js +2 -1
- package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +5 -5
- package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +13 -10
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
- package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
- package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
- package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
- package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +12 -9
- package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +38 -43
- package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
- package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
- package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
- package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
- package/lib/api/ethereum/api/index.d.ts +7 -0
- package/lib/api/ethereum/api/index.js +19 -0
- package/lib/api/ethereum/ethereumSignTx.d.ts +4 -2
- package/lib/api/ethereum/ethereumSignTx.js +19 -3
- package/lib/api/firmware/verifyAuthenticityProof.js +1 -1
- package/lib/api/firmware/x509certificate.d.ts +1 -0
- package/lib/api/firmware/x509certificate.js +34 -2
- package/lib/api/getAccountDescriptor.d.ts +20 -0
- package/lib/api/getAccountDescriptor.js +162 -0
- package/lib/api/getAccountInfo.d.ts +2 -0
- package/lib/api/getAddress.d.ts +1 -1
- package/lib/api/getAddress.js +4 -1
- package/lib/api/index.d.ts +1 -24
- package/lib/api/index.js +3 -50
- package/lib/api/nem/api/index.d.ts +3 -0
- package/lib/api/nem/api/index.js +11 -0
- package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +4 -4
- package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +10 -7
- package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
- package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +7 -6
- package/lib/api/nem/nemSignTx.d.ts +1 -1
- package/lib/api/nem/nemSignTx.js +2 -1
- package/lib/api/ripple/api/index.d.ts +3 -0
- package/lib/api/ripple/api/index.js +11 -0
- package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +4 -4
- package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +10 -7
- package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
- package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +7 -5
- package/lib/api/signTransaction.js +2 -0
- package/lib/api/solana/additionalInfo.d.ts +10 -0
- package/lib/api/solana/additionalInfo.js +33 -0
- package/lib/api/solana/api/index.d.ts +4 -0
- package/lib/api/solana/api/index.js +13 -0
- package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
- package/lib/api/solana/api/solanaGetAddress.js +133 -0
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
- package/lib/api/solana/api/solanaGetPublicKey.js +83 -0
- package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
- package/lib/api/solana/api/solanaSignTransaction.js +34 -0
- package/lib/api/stellar/api/index.d.ts +3 -0
- package/lib/api/stellar/api/index.js +11 -0
- package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +4 -4
- package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +10 -7
- package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
- package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
- package/lib/api/tezos/api/index.d.ts +4 -0
- package/lib/api/tezos/api/index.js +13 -0
- package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +4 -4
- package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +10 -7
- package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
- package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +7 -5
- package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
- package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
- package/lib/api/tezos/tezosSignTx.d.ts +1 -1
- package/lib/api/tezos/tezosSignTx.js +2 -1
- package/lib/backend/Blockchain.js +3 -0
- package/lib/constants/cardano.js +2 -2
- package/lib/constants/nem.js +3 -3
- package/lib/constants/network.d.ts +3 -0
- package/lib/constants/network.js +13 -1
- package/lib/core/AbstractMethod.js +3 -0
- package/lib/core/index.d.ts +3 -1
- package/lib/core/index.js +17 -4
- package/lib/core/method.d.ts +2 -2
- package/lib/core/method.js +8 -2
- package/lib/core/method.native.d.ts +5 -0
- package/lib/core/method.native.js +34 -0
- package/lib/data/DataManager.d.ts +22 -0
- package/lib/data/config.d.ts +22 -0
- package/lib/data/config.js +12 -1
- package/lib/data/connectSettings.js +4 -0
- package/lib/data/defaultFeeLevels.js +9 -0
- package/lib/data/deviceAuthenticityConfig.js +4 -1
- package/lib/data/firmwareInfo.d.ts +1 -1
- package/lib/data/firmwareInfo.js +4 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +3 -1
- package/lib/device/Device.js +23 -4
- package/lib/device/DeviceCommands.d.ts +2 -2
- package/lib/device/DeviceCommands.js +19 -3
- package/lib/device/DeviceList.js +4 -1
- package/lib/events/popup.d.ts +19 -3
- package/lib/events/popup.js +3 -0
- package/lib/events/ui-request.d.ts +1 -1
- package/lib/factory.js +5 -0
- package/lib/types/api/binance/index.d.ts +1 -0
- package/lib/types/api/bitcoin/index.d.ts +2 -0
- package/lib/types/api/cardano/index.d.ts +2 -0
- package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
- package/lib/types/api/cardanoComposeTransaction.js +3 -0
- package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
- package/lib/types/api/composeTransaction.d.ts +28 -54
- package/lib/types/api/eos/index.d.ts +1 -0
- package/lib/types/api/ethereum/index.d.ts +2 -0
- package/lib/types/api/getAccountDescriptor.d.ts +16 -0
- package/lib/types/api/getAccountDescriptor.js +3 -0
- package/lib/types/api/index.d.ts +10 -0
- package/lib/types/api/nem/index.d.ts +1 -0
- package/lib/types/api/ripple/index.d.ts +1 -0
- package/lib/types/api/solana/index.d.ts +22 -0
- package/lib/types/api/solana/index.js +3 -0
- package/lib/types/api/solanaGetAddress.d.ts +4 -0
- package/lib/types/api/solanaGetAddress.js +3 -0
- package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
- package/lib/types/api/solanaGetPublicKey.js +3 -0
- package/lib/types/api/solanaSignTransaction.d.ts +4 -0
- package/lib/types/api/solanaSignTransaction.js +3 -0
- package/lib/types/api/tezos/index.d.ts +1 -0
- package/lib/types/coinInfo.d.ts +5 -16
- package/lib/types/device.d.ts +1 -1
- package/lib/types/device.js +1 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/index.js +1 -0
- package/lib/types/params.d.ts +3 -0
- package/lib/types/settings.d.ts +1 -0
- package/lib/utils/debug.d.ts +6 -3
- package/lib/utils/debug.js +13 -7
- package/lib/utils/deviceFeaturesUtils.js +8 -5
- package/lib/utils/formatUtils.d.ts +2 -0
- package/lib/utils/formatUtils.js +19 -1
- package/lib/workers/workers-browser.d.ts +2 -1
- package/lib/workers/workers-browser.js +3 -1
- package/lib/workers/workers-react-native.d.ts +2 -1
- package/lib/workers/workers-react-native.js +3 -1
- package/lib/workers/workers.d.ts +8 -5
- package/lib/workers/workers.js +34 -10
- package/package.json +22 -19
- package/lib/api/eosGetPublicKey.d.ts +0 -11
- package/lib/api/ethereumGetPublicKey.d.ts +0 -16
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("
|
|
4
|
-
const paramsValidator_1 = require("
|
|
5
|
-
const coinInfo_1 = require("
|
|
6
|
-
const pathUtils_1 = require("
|
|
7
|
-
const events_1 = require("
|
|
3
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
|
+
const events_1 = require("../../../events");
|
|
8
8
|
class TezosGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
9
9
|
init() {
|
|
10
10
|
this.requiredPermissions = ['read'];
|
|
@@ -18,11 +18,13 @@ class TezosGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
|
18
18
|
(0, paramsValidator_1.validateParams)(batch, [
|
|
19
19
|
{ name: 'path', required: true },
|
|
20
20
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
21
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
21
22
|
]);
|
|
22
23
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
23
24
|
return {
|
|
24
25
|
address_n: path,
|
|
25
26
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
27
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
26
28
|
};
|
|
27
29
|
});
|
|
28
30
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import type { PROTO } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import type { PROTO } from '../../../constants';
|
|
3
3
|
export default class TezosSignTransaction extends AbstractMethod<'tezosSignTransaction', PROTO.TezosSignTx> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const AbstractMethod_1 = require("
|
|
5
|
-
const paramsValidator_1 = require("
|
|
6
|
-
const coinInfo_1 = require("
|
|
7
|
-
const pathUtils_1 = require("
|
|
8
|
-
const helper = tslib_1.__importStar(require("
|
|
4
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
|
+
const helper = tslib_1.__importStar(require("../tezosSignTx"));
|
|
9
9
|
class TezosSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
init() {
|
|
11
11
|
this.requiredPermissions = ['read', 'write'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PROTO } from '../../constants';
|
|
2
2
|
import type { TezosOperation } from '../../types/api/tezos';
|
|
3
|
-
export declare const createTx: (address_n: number[], branch: string, operation: TezosOperation) => PROTO.TezosSignTx;
|
|
3
|
+
export declare const createTx: (address_n: number[], branch: string, operation: TezosOperation, chunkify?: boolean) => PROTO.TezosSignTx;
|
|
4
4
|
//# sourceMappingURL=tezosSignTx.d.ts.map
|
|
@@ -60,10 +60,11 @@ const publicKey2buffer = (publicKey) => {
|
|
|
60
60
|
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'Wrong Tezos publicKey');
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
const createTx = (address_n, branch, operation) => {
|
|
63
|
+
const createTx = (address_n, branch, operation, chunkify) => {
|
|
64
64
|
let message = {
|
|
65
65
|
address_n,
|
|
66
66
|
branch: bs58checkDecode(PREFIX.B, branch),
|
|
67
|
+
chunkify: typeof chunkify === 'boolean' ? chunkify : false,
|
|
67
68
|
};
|
|
68
69
|
if (operation.reveal) {
|
|
69
70
|
const { reveal } = operation;
|
|
@@ -16,6 +16,8 @@ const getWorker = (type) => {
|
|
|
16
16
|
return workers_1.BlockfrostWorker;
|
|
17
17
|
case 'electrum':
|
|
18
18
|
return workers_1.ElectrumWorker;
|
|
19
|
+
case 'solana':
|
|
20
|
+
return workers_1.SolanaWorker;
|
|
19
21
|
default:
|
|
20
22
|
return null;
|
|
21
23
|
}
|
|
@@ -43,6 +45,7 @@ class Blockchain {
|
|
|
43
45
|
server,
|
|
44
46
|
debug: options.debug,
|
|
45
47
|
proxy: options.proxy,
|
|
48
|
+
...(blockchainLink.type === 'ripple' ? { throttleBlockEvent: 60 * 1000 } : {}),
|
|
46
49
|
});
|
|
47
50
|
}
|
|
48
51
|
onError(error) {
|
package/lib/constants/cardano.js
CHANGED
|
@@ -7,10 +7,10 @@ var PROTOCOL_MAGICS;
|
|
|
7
7
|
PROTOCOL_MAGICS[PROTOCOL_MAGICS["testnet_preprod"] = 1] = "testnet_preprod";
|
|
8
8
|
PROTOCOL_MAGICS[PROTOCOL_MAGICS["testnet_preview"] = 2] = "testnet_preview";
|
|
9
9
|
PROTOCOL_MAGICS[PROTOCOL_MAGICS["testnet_legacy"] = 1097911063] = "testnet_legacy";
|
|
10
|
-
})(PROTOCOL_MAGICS
|
|
10
|
+
})(PROTOCOL_MAGICS || (exports.PROTOCOL_MAGICS = PROTOCOL_MAGICS = {}));
|
|
11
11
|
var NETWORK_IDS;
|
|
12
12
|
(function (NETWORK_IDS) {
|
|
13
13
|
NETWORK_IDS[NETWORK_IDS["mainnet"] = 1] = "mainnet";
|
|
14
14
|
NETWORK_IDS[NETWORK_IDS["testnet"] = 0] = "testnet";
|
|
15
|
-
})(NETWORK_IDS
|
|
15
|
+
})(NETWORK_IDS || (exports.NETWORK_IDS = NETWORK_IDS = {}));
|
|
16
16
|
//# sourceMappingURL=cardano.js.map
|
package/lib/constants/nem.js
CHANGED
|
@@ -6,7 +6,7 @@ var Networks;
|
|
|
6
6
|
Networks[Networks["mainnet"] = 104] = "mainnet";
|
|
7
7
|
Networks[Networks["testnet"] = 152] = "testnet";
|
|
8
8
|
Networks[Networks["mijin"] = 96] = "mijin";
|
|
9
|
-
})(Networks
|
|
9
|
+
})(Networks || (exports.Networks = Networks = {}));
|
|
10
10
|
var TxType;
|
|
11
11
|
(function (TxType) {
|
|
12
12
|
TxType[TxType["TRANSFER"] = 257] = "TRANSFER";
|
|
@@ -18,11 +18,11 @@ var TxType;
|
|
|
18
18
|
TxType[TxType["PROVISION_NAMESPACE"] = 8193] = "PROVISION_NAMESPACE";
|
|
19
19
|
TxType[TxType["MOSAIC_CREATION"] = 16385] = "MOSAIC_CREATION";
|
|
20
20
|
TxType[TxType["SUPPLY_CHANGE"] = 16386] = "SUPPLY_CHANGE";
|
|
21
|
-
})(TxType
|
|
21
|
+
})(TxType || (exports.TxType = TxType = {}));
|
|
22
22
|
var TxVersion;
|
|
23
23
|
(function (TxVersion) {
|
|
24
24
|
TxVersion[TxVersion["mainnet"] = 1744830464] = "mainnet";
|
|
25
25
|
TxVersion[TxVersion["testnet"] = -1744830464] = "testnet";
|
|
26
26
|
TxVersion[TxVersion["mijin"] = 1610612736] = "mijin";
|
|
27
|
-
})(TxVersion
|
|
27
|
+
})(TxVersion || (exports.TxVersion = TxVersion = {}));
|
|
28
28
|
//# sourceMappingURL=nem.js.map
|
|
@@ -8,6 +8,9 @@ export declare const TYPES: {
|
|
|
8
8
|
readonly ripple: "Ripple";
|
|
9
9
|
readonly tezos: "Tezos";
|
|
10
10
|
readonly binance: "Binance";
|
|
11
|
+
readonly solana: "Solana";
|
|
11
12
|
};
|
|
12
13
|
export type NetworkType = keyof typeof TYPES;
|
|
14
|
+
export declare const MODULES: readonly ["binance", "cardano", "eos", "ethereum", "nem", "ripple", "solana", "stellar", "tezos"];
|
|
15
|
+
export type ModuleName = (typeof MODULES)[number];
|
|
13
16
|
//# sourceMappingURL=network.d.ts.map
|
package/lib/constants/network.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TYPES = void 0;
|
|
3
|
+
exports.MODULES = exports.TYPES = void 0;
|
|
4
4
|
exports.TYPES = {
|
|
5
5
|
bitcoin: 'Bitcoin',
|
|
6
6
|
ethereum: 'Ethereum',
|
|
@@ -11,5 +11,17 @@ exports.TYPES = {
|
|
|
11
11
|
ripple: 'Ripple',
|
|
12
12
|
tezos: 'Tezos',
|
|
13
13
|
binance: 'Binance',
|
|
14
|
+
solana: 'Solana',
|
|
14
15
|
};
|
|
16
|
+
exports.MODULES = [
|
|
17
|
+
'binance',
|
|
18
|
+
'cardano',
|
|
19
|
+
'eos',
|
|
20
|
+
'ethereum',
|
|
21
|
+
'nem',
|
|
22
|
+
'ripple',
|
|
23
|
+
'solana',
|
|
24
|
+
'stellar',
|
|
25
|
+
'tezos',
|
|
26
|
+
];
|
|
15
27
|
//# sourceMappingURL=network.js.map
|
package/lib/core/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from 'events';
|
|
3
3
|
import { TransportInfo, CoreMessage } from '../events';
|
|
4
|
+
import { AbstractMethod } from './AbstractMethod';
|
|
4
5
|
import { LogWriter } from '../utils/debug';
|
|
5
6
|
import type { ConnectSettings } from '../types';
|
|
6
7
|
export declare const handleMessage: (message: CoreMessage) => void;
|
|
@@ -8,8 +9,9 @@ export declare const onCall: (message: CoreMessage) => Promise<void>;
|
|
|
8
9
|
export declare class Core extends EventEmitter {
|
|
9
10
|
handleMessage(message: any): void;
|
|
10
11
|
dispose(): Promise<void>;
|
|
11
|
-
getCurrentMethod():
|
|
12
|
+
getCurrentMethod(): Promise<AbstractMethod<any, undefined>>;
|
|
12
13
|
getTransportInfo(): TransportInfo | undefined;
|
|
14
|
+
enumerate(): void;
|
|
13
15
|
}
|
|
14
16
|
export declare const initCore: (settings: ConnectSettings, logWriterFactory?: () => LogWriter | undefined) => Promise<Core>;
|
|
15
17
|
export declare const initTransport: (settings: ConnectSettings) => Promise<void>;
|
package/lib/core/index.js
CHANGED
|
@@ -19,11 +19,12 @@ let _core;
|
|
|
19
19
|
let _deviceList;
|
|
20
20
|
let _popupPromise;
|
|
21
21
|
const _uiPromises = [];
|
|
22
|
-
const _callMethods = [];
|
|
23
22
|
let _preferredDevice;
|
|
23
|
+
const _callMethods = [];
|
|
24
24
|
let _interactionTimeout;
|
|
25
25
|
let _deviceListInitTimeout;
|
|
26
26
|
let _overridePromise;
|
|
27
|
+
let _getMethodPromise;
|
|
27
28
|
const _log = (0, debug_1.initLog)('Core');
|
|
28
29
|
const postMessage = (message) => {
|
|
29
30
|
if (message.event === events_2.RESPONSE_EVENT) {
|
|
@@ -165,7 +166,10 @@ const onCall = async (message) => {
|
|
|
165
166
|
let method;
|
|
166
167
|
let messageResponse;
|
|
167
168
|
try {
|
|
168
|
-
|
|
169
|
+
_log.debug('loading method...');
|
|
170
|
+
_getMethodPromise = (0, method_1.getMethod)(message);
|
|
171
|
+
method = await _getMethodPromise;
|
|
172
|
+
_log.debug('method selected', method.name);
|
|
169
173
|
method.postMessage = postMessage;
|
|
170
174
|
method.getPopupPromise = getPopupPromise;
|
|
171
175
|
method.createUiPromise = createUiPromise;
|
|
@@ -622,8 +626,11 @@ class Core extends events_1.default {
|
|
|
622
626
|
await _deviceList.dispose();
|
|
623
627
|
}
|
|
624
628
|
}
|
|
625
|
-
getCurrentMethod() {
|
|
626
|
-
|
|
629
|
+
async getCurrentMethod() {
|
|
630
|
+
if (_getMethodPromise) {
|
|
631
|
+
await _getMethodPromise;
|
|
632
|
+
}
|
|
633
|
+
return _callMethods[0];
|
|
627
634
|
}
|
|
628
635
|
getTransportInfo() {
|
|
629
636
|
if (!_deviceList) {
|
|
@@ -631,6 +638,12 @@ class Core extends events_1.default {
|
|
|
631
638
|
}
|
|
632
639
|
return _deviceList.getTransportInfo();
|
|
633
640
|
}
|
|
641
|
+
enumerate() {
|
|
642
|
+
if (!_deviceList) {
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
_deviceList.enumerate();
|
|
646
|
+
}
|
|
634
647
|
}
|
|
635
648
|
exports.Core = Core;
|
|
636
649
|
const initCore = async (settings, logWriterFactory) => {
|
package/lib/core/method.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Methods from '../api';
|
|
2
1
|
import type { IFrameCallMessage } from '../events';
|
|
2
|
+
import type { AbstractMethod } from './AbstractMethod';
|
|
3
3
|
export declare const getMethod: (message: IFrameCallMessage & {
|
|
4
4
|
id?: number;
|
|
5
|
-
}) =>
|
|
5
|
+
}) => Promise<AbstractMethod<any>>;
|
|
6
6
|
//# sourceMappingURL=method.d.ts.map
|
package/lib/core/method.js
CHANGED
|
@@ -4,12 +4,18 @@ exports.getMethod = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Methods = tslib_1.__importStar(require("../api"));
|
|
6
6
|
const errors_1 = require("../constants/errors");
|
|
7
|
-
const
|
|
7
|
+
const network_1 = require("../constants/network");
|
|
8
|
+
const getMethodModule = (method) => network_1.MODULES.find(module => method.startsWith(module));
|
|
9
|
+
const getMethod = async (message) => {
|
|
8
10
|
const { method } = message.payload;
|
|
9
11
|
if (typeof method !== 'string') {
|
|
10
12
|
throw (0, errors_1.TypedError)('Method_InvalidParameter', 'Message method is not set');
|
|
11
13
|
}
|
|
12
|
-
const
|
|
14
|
+
const methodModule = getMethodModule(method);
|
|
15
|
+
const methods = methodModule
|
|
16
|
+
? await Promise.resolve(`${`../api/${methodModule}/api`}`).then(s => tslib_1.__importStar(require(s)))
|
|
17
|
+
: Methods;
|
|
18
|
+
const MethodConstructor = methods[method];
|
|
13
19
|
if (MethodConstructor) {
|
|
14
20
|
return new MethodConstructor(message);
|
|
15
21
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMethod = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Methods = tslib_1.__importStar(require("../api"));
|
|
6
|
+
const errors_1 = require("../constants/errors");
|
|
7
|
+
const network_1 = require("../constants/network");
|
|
8
|
+
const moduleMethods = {
|
|
9
|
+
binance: require('../api/binance/api'),
|
|
10
|
+
cardano: require('../api/cardano/api'),
|
|
11
|
+
eos: require('../api/eos/api'),
|
|
12
|
+
ethereum: require('../api/ethereum/api'),
|
|
13
|
+
nem: require('../api/nem/api'),
|
|
14
|
+
ripple: require('../api/ripple/api'),
|
|
15
|
+
solana: require('../api/solana/api'),
|
|
16
|
+
stellar: require('../api/stellar/api'),
|
|
17
|
+
tezos: require('../api/tezos/api'),
|
|
18
|
+
};
|
|
19
|
+
const getMethodModule = (method) => network_1.MODULES.find(module => method.startsWith(module));
|
|
20
|
+
const getMethod = async (message) => {
|
|
21
|
+
const { method } = message.payload;
|
|
22
|
+
if (typeof method !== 'string') {
|
|
23
|
+
throw (0, errors_1.TypedError)('Method_InvalidParameter', 'Message method is not set');
|
|
24
|
+
}
|
|
25
|
+
const methodModule = getMethodModule(method);
|
|
26
|
+
const methods = methodModule ? moduleMethods[methodModule] : Methods;
|
|
27
|
+
const MethodConstructor = methods[method];
|
|
28
|
+
if (MethodConstructor) {
|
|
29
|
+
return new MethodConstructor(message);
|
|
30
|
+
}
|
|
31
|
+
throw (0, errors_1.TypedError)('Method_InvalidParameter', `Method ${method} not found`);
|
|
32
|
+
};
|
|
33
|
+
exports.getMethod = getMethod;
|
|
34
|
+
//# sourceMappingURL=method.native.js.map
|
|
@@ -145,6 +145,28 @@ export declare class DataManager {
|
|
|
145
145
|
max?: undefined;
|
|
146
146
|
comment?: undefined;
|
|
147
147
|
capabilities?: undefined;
|
|
148
|
+
} | {
|
|
149
|
+
methods: string[];
|
|
150
|
+
min: {
|
|
151
|
+
T1B1: string;
|
|
152
|
+
T2T1: string;
|
|
153
|
+
T2B1: string;
|
|
154
|
+
};
|
|
155
|
+
coin?: undefined;
|
|
156
|
+
max?: undefined;
|
|
157
|
+
comment?: undefined;
|
|
158
|
+
capabilities?: undefined;
|
|
159
|
+
} | {
|
|
160
|
+
capabilities: string[];
|
|
161
|
+
min: {
|
|
162
|
+
T1B1: string;
|
|
163
|
+
T2T1: string;
|
|
164
|
+
T2B1: string;
|
|
165
|
+
};
|
|
166
|
+
comment: string[];
|
|
167
|
+
coin?: undefined;
|
|
168
|
+
methods?: undefined;
|
|
169
|
+
max?: undefined;
|
|
148
170
|
})[];
|
|
149
171
|
};
|
|
150
172
|
}
|
package/lib/data/config.d.ts
CHANGED
|
@@ -133,6 +133,28 @@ export declare const config: {
|
|
|
133
133
|
max?: undefined;
|
|
134
134
|
comment?: undefined;
|
|
135
135
|
capabilities?: undefined;
|
|
136
|
+
} | {
|
|
137
|
+
methods: string[];
|
|
138
|
+
min: {
|
|
139
|
+
T1B1: string;
|
|
140
|
+
T2T1: string;
|
|
141
|
+
T2B1: string;
|
|
142
|
+
};
|
|
143
|
+
coin?: undefined;
|
|
144
|
+
max?: undefined;
|
|
145
|
+
comment?: undefined;
|
|
146
|
+
capabilities?: undefined;
|
|
147
|
+
} | {
|
|
148
|
+
capabilities: string[];
|
|
149
|
+
min: {
|
|
150
|
+
T1B1: string;
|
|
151
|
+
T2T1: string;
|
|
152
|
+
T2B1: string;
|
|
153
|
+
};
|
|
154
|
+
comment: string[];
|
|
155
|
+
coin?: undefined;
|
|
156
|
+
methods?: undefined;
|
|
157
|
+
max?: undefined;
|
|
136
158
|
})[];
|
|
137
159
|
};
|
|
138
160
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/data/config.js
CHANGED
|
@@ -108,7 +108,7 @@ exports.config = {
|
|
|
108
108
|
],
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
|
-
coin: ['eth', 'tsep', 'tgor'],
|
|
111
|
+
coin: ['eth', 'tsep', 'tgor', 'thol'],
|
|
112
112
|
min: { T1B1: '1.8.0', T2T1: '2.1.0' },
|
|
113
113
|
comment: ['There were protobuf backwards incompatible changes.'],
|
|
114
114
|
},
|
|
@@ -212,6 +212,17 @@ exports.config = {
|
|
|
212
212
|
methods: ['getFirmwareHash'],
|
|
213
213
|
min: { T1B1: '1.11.1', T2T1: '2.5.1' },
|
|
214
214
|
},
|
|
215
|
+
{
|
|
216
|
+
methods: ['solanaGetPublicKey', 'solanaGetAddress', 'solanaSignTransaction'],
|
|
217
|
+
min: { T1B1: '0', T2T1: '2.6.4', T2B1: '2.6.4' },
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
capabilities: ['chunkify'],
|
|
221
|
+
min: { T1B1: '0', T2T1: '2.6.3', T2B1: '2.6.3' },
|
|
222
|
+
comment: [
|
|
223
|
+
"Since firmware 2.6.3 there is a new protobuf field 'chunkify' in almost all getAddress and signTx methods",
|
|
224
|
+
],
|
|
225
|
+
},
|
|
215
226
|
],
|
|
216
227
|
};
|
|
217
228
|
//# sourceMappingURL=config.js.map
|
|
@@ -20,6 +20,7 @@ const initialSettings = {
|
|
|
20
20
|
lazyLoad: false,
|
|
21
21
|
timestamp: new Date().getTime(),
|
|
22
22
|
interactionTimeout: 600,
|
|
23
|
+
sharedLogger: true,
|
|
23
24
|
};
|
|
24
25
|
const parseManifest = (manifest) => {
|
|
25
26
|
if (!manifest)
|
|
@@ -103,6 +104,9 @@ const parseConnectSettings = (input = {}) => {
|
|
|
103
104
|
if (typeof input.manifest === 'object') {
|
|
104
105
|
settings.manifest = parseManifest(input.manifest);
|
|
105
106
|
}
|
|
107
|
+
if (typeof input.sharedLogger === 'boolean') {
|
|
108
|
+
settings.sharedLogger = input.sharedLogger;
|
|
109
|
+
}
|
|
106
110
|
return settings;
|
|
107
111
|
};
|
|
108
112
|
exports.parseConnectSettings = parseConnectSettings;
|
|
@@ -64,11 +64,20 @@ const CARDANO_FEE_INFO = {
|
|
|
64
64
|
maxFee: 16384 * 44 + 155381,
|
|
65
65
|
dustLimit: -1,
|
|
66
66
|
};
|
|
67
|
+
const SOLANA_FEE_INFO = {
|
|
68
|
+
blockTime: -1,
|
|
69
|
+
defaultFees: [{ label: 'normal', feePerUnit: '5000', blocks: -1 }],
|
|
70
|
+
minFee: -1,
|
|
71
|
+
maxFee: -1,
|
|
72
|
+
dustLimit: -1,
|
|
73
|
+
};
|
|
67
74
|
const MISC_FEE_LEVELS = {
|
|
68
75
|
xrp: RIPPLE_FEE_INFO,
|
|
69
76
|
txrp: RIPPLE_FEE_INFO,
|
|
70
77
|
ada: CARDANO_FEE_INFO,
|
|
71
78
|
tada: CARDANO_FEE_INFO,
|
|
79
|
+
sol: SOLANA_FEE_INFO,
|
|
80
|
+
dsol: SOLANA_FEE_INFO,
|
|
72
81
|
};
|
|
73
82
|
const getMiscFeeLevels = (data) => {
|
|
74
83
|
const shortcut = data.shortcut.toLowerCase();
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deviceAuthenticityConfig = void 0;
|
|
4
4
|
exports.deviceAuthenticityConfig = {
|
|
5
5
|
version: 1,
|
|
6
|
-
timestamp: '2023-
|
|
6
|
+
timestamp: '2023-12-14T12:00:00+00:00',
|
|
7
7
|
T2B1: {
|
|
8
8
|
rootPubKeys: [
|
|
9
9
|
'04ca97480ac0d7b1e6efafe518cd433cec2bf8ab9822d76eafd34363b55d63e60380bff20acc75cde03cffcb50ab6f8ce70c878e37ebc58ff7cca0a83b16b15fa5',
|
|
@@ -12,6 +12,9 @@ exports.deviceAuthenticityConfig = {
|
|
|
12
12
|
'04b12efa295ad825a534b7c0bf276e93ad116434426763fa87bfa8a2f12e726906dcf566813f62eba8f8795f94dba0391c53682809cbbd7e4ba01d960b4f1c68f1',
|
|
13
13
|
'04cb87d4c5d0fd5854e829f4c1b666e49a86c25c88a904c0feb66f1338faed0d7760010d7ea1a6474cbcfe1143bd4b5397a4e8b7fe86899113caecf42a984b0c0f',
|
|
14
14
|
'0450c45878b2c6403a5a16e97a8957dc3ea36919bce9321b357f6e7ebe6257ee54102a2c2fa5cefed1dabc498fc76dc0bcf3c3a8a415eac7cc32e7c18185f25b0d',
|
|
15
|
+
'0454d310d88d55d3044d80fcdbce9a63bf3118545fae71f6eca303272dcc4d25cf775ae3c18ae9f41b2cf29377bc4696fc79c8824a6fd6b9ca5fb6805ed6557aab',
|
|
16
|
+
'04e94bf05586a8e7a3e9aba32662a439be5f378da372219c8ee7cf8b4684dbfbd7ba88ed920c06f9f26deab9077654647738df8cf70898fea1c3aaf2ef086fc578',
|
|
17
|
+
'048c6c104bd7cc59cd5c5717533786a72ab59685bd13937f5542820e90f6ac6945e520e19d1d627a8e81ef5a94ef87de7a6a0d778e7dc9d389db877a5f9b629dd8',
|
|
15
18
|
],
|
|
16
19
|
debug: {
|
|
17
20
|
rootPubKeys: [
|
|
@@ -6,7 +6,7 @@ export interface GetInfoProps {
|
|
|
6
6
|
releases: FirmwareRelease[];
|
|
7
7
|
}
|
|
8
8
|
export declare const getInfo: ({ features, releases }: GetInfoProps) => ReleaseInfo | null;
|
|
9
|
-
export declare const getFirmwareStatus: (features: Features) => "valid" | "outdated" | "required" | "unknown" | "none";
|
|
9
|
+
export declare const getFirmwareStatus: (features: Features) => "custom" | "valid" | "outdated" | "required" | "unknown" | "none";
|
|
10
10
|
export declare const getRelease: (features: Features) => ReleaseInfo | null;
|
|
11
11
|
export declare const getReleases: (deviceModel: DeviceModelInternal) => FirmwareRelease[];
|
|
12
12
|
//# sourceMappingURL=firmwareInfo.d.ts.map
|
package/lib/data/firmwareInfo.js
CHANGED
|
@@ -95,6 +95,9 @@ const getSafeReleases = ({ features, releases }) => {
|
|
|
95
95
|
return (0, firmwareUtils_1.filterSafeListByFirmware)(releases, firmwareVersion);
|
|
96
96
|
};
|
|
97
97
|
const getInfo = ({ features, releases }) => {
|
|
98
|
+
if (!Array.isArray(releases)) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
98
101
|
if (!(0, firmwareUtils_1.isStrictFeatures)(features)) {
|
|
99
102
|
throw new Error('Features of unexpected shape provided.');
|
|
100
103
|
}
|
|
@@ -131,7 +134,7 @@ const getFirmwareStatus = (features) => {
|
|
|
131
134
|
releases: releases[features === null || features === void 0 ? void 0 : features.internal_model],
|
|
132
135
|
});
|
|
133
136
|
if (!info)
|
|
134
|
-
return '
|
|
137
|
+
return 'custom';
|
|
135
138
|
if (info.isRequired)
|
|
136
139
|
return 'required';
|
|
137
140
|
if (info.isNewer)
|
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.1.
|
|
4
|
+
exports.VERSION = '9.1.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.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TypedEmitter } from '@trezor/utils/lib/typedEventEmitter';
|
|
2
2
|
import { Deferred } from '@trezor/utils';
|
|
3
|
+
import { TransportProtocol } from '@trezor/protocol';
|
|
3
4
|
import { DeviceCommands } from './DeviceCommands';
|
|
4
5
|
import { PROTO, NETWORK } from '../constants';
|
|
5
6
|
import { DEVICE, DeviceButtonRequestPayload } from '../events';
|
|
@@ -24,6 +25,7 @@ export interface DeviceEvents {
|
|
|
24
25
|
}
|
|
25
26
|
export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
26
27
|
transport: Transport;
|
|
28
|
+
protocol: TransportProtocol;
|
|
27
29
|
originalDescriptor: Descriptor;
|
|
28
30
|
unreadableError?: string;
|
|
29
31
|
firmwareStatus: DeviceFirmwareStatus;
|
|
@@ -90,7 +92,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
90
92
|
dispose(): import("packages/transport/lib/types").AbortableCall<void, "Network request failed" | "Wrong result type." | "device disconnected during action" | "unexpected error" | "Aborted by timeout" | "Aborted by signal" | "This transport can not be used in this environment" | "device not found" | "Unable to open device" | "wrong previous session" | "session not found"> | undefined;
|
|
91
93
|
getMode(): "normal" | "bootloader" | "initialize" | "seedless";
|
|
92
94
|
toMessageObject(): DeviceTyped;
|
|
93
|
-
_getNetworkTypeState(): "
|
|
95
|
+
_getNetworkTypeState(): "binance" | "cardano" | "eos" | "ethereum" | "nem" | "ripple" | "solana" | "stellar" | "tezos" | "bitcoin";
|
|
94
96
|
_setNetworkTypeState(networkType?: NETWORK.NetworkType): void;
|
|
95
97
|
_altModeChange(networkType?: NETWORK.NetworkType): boolean;
|
|
96
98
|
_isAltModeNetworkType(networkType?: keyof typeof NETWORK.TYPES): boolean;
|
package/lib/device/Device.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Device = void 0;
|
|
4
4
|
const typedEventEmitter_1 = require("@trezor/utils/lib/typedEventEmitter");
|
|
5
5
|
const utils_1 = require("@trezor/utils");
|
|
6
|
+
const protocol_1 = require("@trezor/protocol");
|
|
6
7
|
const DeviceCommands_1 = require("./DeviceCommands");
|
|
7
8
|
const constants_1 = require("../constants");
|
|
8
9
|
const events_1 = require("../events");
|
|
@@ -33,6 +34,12 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
33
34
|
this.unavailableCapabilities = {};
|
|
34
35
|
this.networkTypeState = [];
|
|
35
36
|
this.name = 'Trezor';
|
|
37
|
+
if (transport.name === 'BridgeTransport') {
|
|
38
|
+
this.protocol = protocol_1.bridge;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.protocol = protocol_1.v1;
|
|
42
|
+
}
|
|
36
43
|
this.transport = transport;
|
|
37
44
|
this.originalDescriptor = descriptor;
|
|
38
45
|
this.firstRunPromise = (0, utils_1.createDeferred)();
|
|
@@ -117,7 +124,10 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
117
124
|
options = parseRunOptions(options);
|
|
118
125
|
const runPromise = (0, utils_1.createDeferred)();
|
|
119
126
|
this.runPromise = runPromise;
|
|
120
|
-
|
|
127
|
+
this._runInner(fn, options).catch(err => {
|
|
128
|
+
runPromise.reject(err);
|
|
129
|
+
});
|
|
130
|
+
return runPromise.promise;
|
|
121
131
|
}
|
|
122
132
|
async override(error) {
|
|
123
133
|
if (this.acquirePromise) {
|
|
@@ -300,7 +310,7 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
300
310
|
this._updateFeatures(message);
|
|
301
311
|
}
|
|
302
312
|
_updateFeatures(feat) {
|
|
303
|
-
var _a;
|
|
313
|
+
var _a, _b;
|
|
304
314
|
const capabilities = (0, deviceFeaturesUtils_1.parseCapabilities)(feat);
|
|
305
315
|
feat.capabilities = capabilities;
|
|
306
316
|
if (this.features && this.features.session_id && !feat.session_id) {
|
|
@@ -327,7 +337,13 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
327
337
|
}
|
|
328
338
|
this.features = feat;
|
|
329
339
|
this.featuresNeedsReload = false;
|
|
330
|
-
if (
|
|
340
|
+
if (feat.fw_vendor === 'Trezor Bitcoin-only') {
|
|
341
|
+
this.firmwareType = types_1.FirmwareType.BitcoinOnly;
|
|
342
|
+
}
|
|
343
|
+
else if (feat.fw_vendor === 'Trezor') {
|
|
344
|
+
this.firmwareType = types_1.FirmwareType.Regular;
|
|
345
|
+
}
|
|
346
|
+
else if (this.getMode() !== 'bootloader') {
|
|
331
347
|
this.firmwareType =
|
|
332
348
|
feat.capabilities &&
|
|
333
349
|
feat.capabilities.length > 0 &&
|
|
@@ -335,7 +351,10 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
335
351
|
? types_1.FirmwareType.BitcoinOnly
|
|
336
352
|
: types_1.FirmwareType.Regular;
|
|
337
353
|
}
|
|
338
|
-
const deviceInfo = models_1.models[feat.internal_model]
|
|
354
|
+
const deviceInfo = (_b = models_1.models[feat.internal_model]) !== null && _b !== void 0 ? _b : {
|
|
355
|
+
name: `Unknown ${feat.internal_model}`,
|
|
356
|
+
colors: {},
|
|
357
|
+
};
|
|
339
358
|
this.name = deviceInfo.name;
|
|
340
359
|
if (feat === null || feat === void 0 ? void 0 : feat.unit_color) {
|
|
341
360
|
const deviceUnitColor = feat.unit_color.toString();
|
|
@@ -36,12 +36,12 @@ export declare class DeviceCommands {
|
|
|
36
36
|
unlockPath?: Messages.UnlockPath;
|
|
37
37
|
}): Promise<HDNodeResponse>;
|
|
38
38
|
getBitcoinHDNode(path: number[], coinInfo?: BitcoinNetworkInfo, validation?: boolean): Promise<HDNodeResponse>;
|
|
39
|
-
getAddress({ address_n, show_display, multisig, script_type }: Messages.GetAddress, coinInfo: BitcoinNetworkInfo): Promise<{
|
|
39
|
+
getAddress({ address_n, show_display, multisig, script_type, chunkify }: Messages.GetAddress, coinInfo: BitcoinNetworkInfo): Promise<{
|
|
40
40
|
path: number[];
|
|
41
41
|
serializedPath: string;
|
|
42
42
|
address: string;
|
|
43
43
|
}>;
|
|
44
|
-
ethereumGetAddress({ address_n, show_display, encoded_network, }: Messages.EthereumGetAddress): Promise<{
|
|
44
|
+
ethereumGetAddress({ address_n, show_display, encoded_network, chunkify, }: Messages.EthereumGetAddress): Promise<{
|
|
45
45
|
path: number[];
|
|
46
46
|
serializedPath: string;
|
|
47
47
|
address: string;
|