@trezor/connect 9.4.3-beta.1 → 9.4.3-beta.2
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 +43 -4
- package/README.md +1 -1
- package/lib/api/applyFlags.js +1 -1
- package/lib/api/applySettings.js +1 -1
- package/lib/api/authenticateDevice.js +1 -1
- package/lib/api/authorizeCoinjoin.js +1 -1
- package/lib/api/backupDevice.js +1 -1
- package/lib/api/binance/api/binanceGetAddress.js +2 -1
- package/lib/api/binance/api/binanceGetPublicKey.js +2 -1
- package/lib/api/binance/api/binanceSignTransaction.js +2 -1
- package/lib/api/binance/binanceSignTx.js +1 -1
- package/lib/api/bitcoin/Fees.js +2 -2
- package/lib/api/bitcoin/TransactionComposer.d.ts +3 -3
- package/lib/api/bitcoin/TransactionComposer.js +2 -2
- package/lib/api/bitcoin/refTx.js +1 -1
- package/lib/api/blockchainDisconnect.js +1 -1
- package/lib/api/blockchainEvmRpcCall.d.ts +16 -0
- package/lib/api/blockchainEvmRpcCall.js +45 -0
- package/lib/api/cancelCoinjoinAuthorization.js +1 -1
- package/lib/api/cardano/api/cardanoGetAddress.js +2 -1
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +2 -1
- package/lib/api/cardano/api/cardanoGetPublicKey.js +2 -1
- package/lib/api/cardano/api/cardanoSignTransaction.js +2 -1
- package/lib/api/cardano/cardanoAddressParameters.js +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.js +1 -1
- package/lib/api/cardano/cardanoCertificate.js +1 -1
- package/lib/api/cardano/cardanoInputs.d.ts +8 -8
- package/lib/api/cardano/cardanoInputs.js +1 -1
- package/lib/api/cardano/cardanoOutputs.d.ts +22 -22
- package/lib/api/cardano/cardanoOutputs.js +1 -1
- package/lib/api/cardano/cardanoTokenBundle.d.ts +6 -6
- package/lib/api/cardano/cardanoTokenBundle.js +1 -1
- package/lib/api/changeLanguage.js +1 -1
- package/lib/api/changePin.js +1 -1
- package/lib/api/cipherKeyValue.js +1 -1
- package/lib/api/common/paramsValidator.js +1 -1
- package/lib/api/composeTransaction.d.ts +9 -3
- package/lib/api/composeTransaction.js +7 -4
- package/lib/api/eos/api/eosGetPublicKey.js +2 -1
- package/lib/api/eos/api/eosSignTransaction.js +2 -1
- package/lib/api/eos/eosSignTx.d.ts +3 -3
- package/lib/api/ethereum/api/ethereumGetAddress.js +2 -1
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +2 -1
- package/lib/api/ethereum/api/ethereumSignMessage.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumSignMessage.js +2 -1
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumSignTransaction.js +13 -7
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +58 -57
- package/lib/api/ethereum/api/ethereumSignTypedData.js +3 -2
- package/lib/api/ethereum/api/ethereumVerifyMessage.js +2 -1
- package/lib/api/ethereum/ethereumDefinitions.d.ts +21 -21
- package/lib/api/ethereum/ethereumDefinitions.js +6 -5
- package/lib/api/firmware/getBinary.js +1 -1
- package/lib/api/firmware/x509certificate.js +3 -5
- package/lib/api/getAccountDescriptor.js +1 -1
- package/lib/api/getAddress.js +1 -1
- package/lib/api/getCoinInfo.d.ts +3 -0
- package/lib/api/getCoinInfo.js +1 -1
- package/lib/api/getFirmwareHash.js +1 -1
- package/lib/api/getOwnershipId.js +1 -1
- package/lib/api/getOwnershipProof.js +1 -1
- package/lib/api/getPublicKey.js +1 -1
- package/lib/api/index.d.ts +2 -1
- package/lib/api/index.js +5 -3
- package/lib/api/loadDevice.d.ts +14 -0
- package/lib/api/loadDevice.js +44 -0
- package/lib/api/nem/api/nemGetAddress.js +2 -1
- package/lib/api/nem/api/nemSignTransaction.js +2 -1
- package/lib/api/pushTransaction.js +1 -1
- package/lib/api/rebootToBootloader.js +1 -1
- package/lib/api/recoveryDevice.js +1 -1
- package/lib/api/requestLogin.js +1 -1
- package/lib/api/resetDevice.js +1 -1
- package/lib/api/ripple/api/rippleGetAddress.js +2 -1
- package/lib/api/ripple/api/rippleSignTransaction.js +2 -1
- package/lib/api/setBrightness.js +1 -1
- package/lib/api/setBusy.js +1 -1
- package/lib/api/signMessage.js +1 -1
- package/lib/api/solana/api/solanaGetAddress.js +2 -1
- package/lib/api/solana/api/solanaGetPublicKey.js +2 -1
- package/lib/api/solana/api/solanaSignTransaction.js +2 -1
- package/lib/api/stellar/api/stellarGetAddress.js +2 -1
- package/lib/api/stellar/api/stellarSignTransaction.js +2 -1
- package/lib/api/stellar/stellarSignTx.js +1 -1
- package/lib/api/tezos/api/tezosGetAddress.js +2 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +2 -1
- package/lib/api/tezos/api/tezosSignTransaction.js +2 -1
- package/lib/api/tezos/tezosSignTx.js +1 -1
- package/lib/api/unlockPath.js +1 -1
- package/lib/api/verifyMessage.js +1 -1
- package/lib/backend/Blockchain.d.ts +3 -0
- package/lib/backend/Blockchain.js +3 -0
- package/lib/constants/errors.d.ts +3 -0
- package/lib/constants/errors.js +3 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +3 -1
- package/lib/constants/nem.d.ts +3 -3
- package/lib/constants/utxo.d.ts +3 -0
- package/lib/constants/utxo.js +5 -0
- package/lib/core/AbstractMethod.d.ts +13 -5
- package/lib/core/AbstractMethod.js +50 -24
- package/lib/core/index.js +41 -30
- package/lib/core/onCallFirmwareUpdate.d.ts +2 -2
- package/lib/core/onCallFirmwareUpdate.js +5 -5
- package/lib/data/DataManager.d.ts +0 -181
- package/lib/data/DataManager.js +40 -6
- package/lib/data/analyticsInfo.js +2 -1
- package/lib/data/coinInfo.d.ts +14 -0
- package/lib/data/config.d.ts +20 -22
- package/lib/data/config.js +15 -40
- package/lib/data/connectSettings.js +5 -4
- package/lib/data/deviceAuthenticityConfig.js +17 -0
- package/lib/data/deviceAuthenticityConfigTypes.d.ts +32 -23
- package/lib/data/firmwareInfo.d.ts +1 -1
- package/lib/data/models.d.ts +9 -0
- package/lib/data/models.js +9 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +143 -36
- package/lib/device/Device.js +226 -119
- package/lib/device/DeviceCommands.js +4 -4
- package/lib/device/DeviceList.d.ts +13 -21
- package/lib/device/DeviceList.js +54 -168
- package/lib/device/prompts.js +3 -2
- package/lib/device/resolveDescriptorForTaproot.d.ts +1 -1
- package/lib/events/call.d.ts +5 -5
- package/lib/events/call.js +2 -2
- package/lib/events/device.d.ts +0 -6
- package/lib/events/device.js +0 -6
- package/lib/events/transport.d.ts +1 -1
- package/lib/factory.d.ts +6 -6
- package/lib/factory.js +132 -136
- package/lib/impl/dynamic.d.ts +13 -19
- package/lib/impl/dynamic.js +0 -9
- package/lib/index-browser.d.ts +3 -1
- package/lib/index-browser.js +0 -3
- package/lib/index.d.ts +3 -1
- package/lib/index.js +1 -13
- package/lib/types/api/applySettings.d.ts +13 -13
- package/lib/types/api/authenticateDevice.d.ts +33 -24
- package/lib/types/api/authorizeCoinjoin.d.ts +10 -10
- package/lib/types/api/binance/index.d.ts +143 -143
- package/lib/types/api/binance/index.js +1 -1
- package/lib/types/api/bitcoin/index.d.ts +11 -11
- package/lib/types/api/bitcoin/index.js +1 -1
- package/lib/types/api/blockchainEvmRpcCall.d.ts +4 -0
- package/lib/types/api/{checkFirmwareAuthenticity.js → blockchainEvmRpcCall.js} +1 -1
- package/lib/types/api/cancelCoinjoinAuthorization.d.ts +1 -1
- package/lib/types/api/cardano/index.d.ts +507 -507
- package/lib/types/api/changeLanguage.d.ts +6 -6
- package/lib/types/api/cipherKeyValue.d.ts +8 -8
- package/lib/types/api/cipherKeyValue.js +1 -1
- package/lib/types/api/composeTransaction.d.ts +13 -7
- package/lib/types/api/eos/index.d.ts +525 -525
- package/lib/types/api/eos/index.js +1 -1
- package/lib/types/api/ethereum/index.d.ts +100 -100
- package/lib/types/api/firmwareUpdate.d.ts +5 -5
- package/lib/types/api/getAccountDescriptor.d.ts +4 -4
- package/lib/types/api/getAddress.d.ts +32 -32
- package/lib/types/api/getOwnershipId.d.ts +24 -24
- package/lib/types/api/getOwnershipProof.d.ts +28 -28
- package/lib/types/api/getPublicKey.d.ts +24 -24
- package/lib/types/api/getPublicKey.js +1 -1
- package/lib/types/api/index.d.ts +4 -8
- package/lib/types/api/init.d.ts +4 -2
- package/lib/types/api/loadDevice.d.ts +4 -0
- package/lib/types/api/loadDevice.js +3 -0
- package/lib/types/api/nem/index.d.ts +612 -612
- package/lib/types/api/nem/index.js +1 -1
- package/lib/types/api/nemGetAddress.d.ts +6 -6
- package/lib/types/api/pushTransaction.d.ts +3 -3
- package/lib/types/api/recoveryDevice.d.ts +9 -9
- package/lib/types/api/requestLogin.d.ts +25 -25
- package/lib/types/api/ripple/index.d.ts +21 -21
- package/lib/types/api/ripple/index.js +1 -1
- package/lib/types/api/solana/index.d.ts +23 -23
- package/lib/types/api/solana/index.js +1 -1
- package/lib/types/api/stellar/index.d.ts +582 -582
- package/lib/types/api/stellar/index.js +1 -1
- package/lib/types/api/tezos/index.d.ts +120 -120
- package/lib/types/api/tezos/index.js +1 -1
- package/lib/types/api/unlockPath.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +231 -224
- package/lib/types/device.d.ts +13 -1
- package/lib/types/device.js +3 -1
- package/lib/types/fees.d.ts +19 -19
- package/lib/types/firmware.d.ts +1 -1
- package/lib/types/params.d.ts +21 -18
- package/lib/types/settings.d.ts +15 -9
- package/lib/types/utils.d.ts +1 -0
- package/lib/types/utils.js +3 -0
- package/lib/utils/addressUtils.js +2 -2
- package/lib/utils/assetUtils.js +3 -3
- package/lib/utils/deviceFeaturesUtils.js +1 -1
- package/lib/utils/uiPromiseManager.d.ts +2 -1
- package/lib/utils/uiPromiseManager.js +3 -3
- package/package.json +12 -12
- package/lib/api/checkFirmwareAuthenticity.d.ts +0 -11
- package/lib/api/checkFirmwareAuthenticity.js +0 -63
- package/lib/types/api/checkFirmwareAuthenticity.d.ts +0 -11
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CardanoAssetGroup } from '../../types/api/cardano';
|
|
2
1
|
import { Static } from '@trezor/schema-utils';
|
|
2
|
+
import { CardanoAssetGroup } from '../../types/api/cardano';
|
|
3
3
|
export type AssetGroupWithTokens = Static<typeof AssetGroupWithTokens>;
|
|
4
4
|
export declare const AssetGroupWithTokens: import("@trezor/schema-utils").TObject<{
|
|
5
|
-
policyId: import("@
|
|
6
|
-
tokens: import("@
|
|
7
|
-
asset_name_bytes: import("@
|
|
8
|
-
amount: import("@
|
|
9
|
-
mint_amount: import("@
|
|
5
|
+
policyId: import("@trezor/schema-utils").TString;
|
|
6
|
+
tokens: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
7
|
+
asset_name_bytes: import("@trezor/schema-utils").TString;
|
|
8
|
+
amount: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils/lib/custom-types/uint").TUint>;
|
|
9
|
+
mint_amount: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils/lib/custom-types/uint").TUint>;
|
|
10
10
|
}>>;
|
|
11
11
|
}>;
|
|
12
12
|
export declare const tokenBundleToProto: (tokenBundle: CardanoAssetGroup[]) => AssetGroupWithTokens[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tokenBundleToProto = exports.AssetGroupWithTokens = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const constants_1 = require("../../constants");
|
|
5
6
|
const cardano_1 = require("../../types/api/cardano");
|
|
6
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
7
7
|
exports.AssetGroupWithTokens = schema_utils_1.Type.Object({
|
|
8
8
|
policyId: schema_utils_1.Type.String(),
|
|
9
9
|
tokens: schema_utils_1.Type.Array(constants_1.PROTO.CardanoToken, { minItems: 1 }),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
5
|
const events_1 = require("../events");
|
|
5
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
6
6
|
const changeLanguage_1 = require("../types/api/changeLanguage");
|
|
7
7
|
class ChangeLanguage extends AbstractMethod_1.AbstractMethod {
|
|
8
8
|
init() {
|
package/lib/api/changePin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
class ChangePin extends AbstractMethod_1.AbstractMethod {
|
|
7
7
|
init() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const events_1 = require("../events");
|
|
4
5
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
6
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
7
|
const pathUtils_1 = require("../utils/pathUtils");
|
|
7
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
8
8
|
const params_1 = require("../types/params");
|
|
9
9
|
const cipherKeyValue_1 = require("../types/api/cipherKeyValue");
|
|
10
10
|
class CipherKeyValue extends AbstractMethod_1.AbstractMethod {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BigNumber } from '@trezor/utils/lib/bigNumber';
|
|
2
|
+
import type { ComposeOutput, TransactionInputOutputSortingStrategy } from '@trezor/utxo-lib';
|
|
2
3
|
import { AbstractMethod } from '../core/AbstractMethod';
|
|
3
4
|
import { Discovery } from './common/Discovery';
|
|
4
5
|
import { TransactionComposer } from './bitcoin';
|
|
5
|
-
import type { ComposeOutput } from '@trezor/utxo-lib';
|
|
6
6
|
import type { BitcoinNetworkInfo, DiscoveryAccount, AccountUtxo } from '../types';
|
|
7
7
|
import type { SignedTransaction, PrecomposeParams, ComposeResult, PrecomposedResult } from '../types/api/composeTransaction';
|
|
8
8
|
type Params = {
|
|
@@ -15,9 +15,15 @@ type Params = {
|
|
|
15
15
|
baseFee?: PrecomposeParams['baseFee'];
|
|
16
16
|
floorBaseFee?: PrecomposeParams['floorBaseFee'];
|
|
17
17
|
sequence?: PrecomposeParams['sequence'];
|
|
18
|
-
skipPermutation?: PrecomposeParams['skipPermutation'];
|
|
19
18
|
total: BigNumber;
|
|
20
|
-
|
|
19
|
+
sortingStrategy: PrecomposeParams['sortingStrategy'];
|
|
20
|
+
} & ({
|
|
21
|
+
skipPermutation?: PrecomposeParams['skipPermutation'];
|
|
22
|
+
sortingStrategy?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
skipPermutation?: undefined;
|
|
25
|
+
sortingStrategy?: TransactionInputOutputSortingStrategy;
|
|
26
|
+
});
|
|
21
27
|
export default class ComposeTransaction extends AbstractMethod<'composeTransaction', Params> {
|
|
22
28
|
discovery?: Discovery;
|
|
23
29
|
init(): void;
|
|
@@ -13,6 +13,7 @@ const formatUtils_1 = require("../utils/formatUtils");
|
|
|
13
13
|
const coinInfo_1 = require("../data/coinInfo");
|
|
14
14
|
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
15
15
|
const bitcoin_1 = require("./bitcoin");
|
|
16
|
+
const utxo_1 = require("../constants/utxo");
|
|
16
17
|
class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
17
18
|
init() {
|
|
18
19
|
this.requiredPermissions = ['read', 'write'];
|
|
@@ -28,6 +29,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
28
29
|
{ name: 'floorBaseFee', type: 'boolean' },
|
|
29
30
|
{ name: 'sequence', type: 'number' },
|
|
30
31
|
{ name: 'skipPermutation', type: 'boolean' },
|
|
32
|
+
{ name: 'sortingStrategy', type: 'string' },
|
|
31
33
|
]);
|
|
32
34
|
const coinInfo = (0, coinInfo_1.getBitcoinNetwork)(payload.coin);
|
|
33
35
|
if (!coinInfo) {
|
|
@@ -55,7 +57,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
55
57
|
baseFee: payload.baseFee,
|
|
56
58
|
floorBaseFee: payload.floorBaseFee,
|
|
57
59
|
sequence: payload.sequence,
|
|
58
|
-
skipPermutation: payload.
|
|
60
|
+
sortingStrategy: payload.skipPermutation === true ? 'none' : payload.sortingStrategy,
|
|
59
61
|
push: typeof payload.push === 'boolean' ? payload.push : false,
|
|
60
62
|
total,
|
|
61
63
|
};
|
|
@@ -75,7 +77,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
75
77
|
return (0, BlockchainLink_1.initBlockchain)(this.params.coinInfo, this.postMessage, this.params.identity);
|
|
76
78
|
}
|
|
77
79
|
async precompose(account, feeLevels) {
|
|
78
|
-
const { coinInfo, outputs, baseFee,
|
|
80
|
+
const { coinInfo, outputs, baseFee, sortingStrategy } = this.params;
|
|
79
81
|
const address_n = pathUtils.validatePath(account.path);
|
|
80
82
|
const composer = new bitcoin_1.TransactionComposer({
|
|
81
83
|
account: {
|
|
@@ -89,7 +91,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
89
91
|
coinInfo,
|
|
90
92
|
outputs,
|
|
91
93
|
baseFee,
|
|
92
|
-
|
|
94
|
+
sortingStrategy: sortingStrategy !== null && sortingStrategy !== void 0 ? sortingStrategy : utxo_1.DEFAULT_SORTING_STRATEGY,
|
|
93
95
|
});
|
|
94
96
|
const blockchain = await this.getBlockchain();
|
|
95
97
|
await composer.init(blockchain);
|
|
@@ -188,13 +190,14 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
188
190
|
};
|
|
189
191
|
}
|
|
190
192
|
async selectFee(account, utxos) {
|
|
191
|
-
const { coinInfo, outputs } = this.params;
|
|
193
|
+
const { coinInfo, outputs, sortingStrategy, skipPermutation } = this.params;
|
|
192
194
|
const blockchain = await this.getBlockchain();
|
|
193
195
|
const composer = new bitcoin_1.TransactionComposer({
|
|
194
196
|
account,
|
|
195
197
|
utxos,
|
|
196
198
|
coinInfo,
|
|
197
199
|
outputs,
|
|
200
|
+
sortingStrategy: skipPermutation === true ? 'none' : sortingStrategy !== null && sortingStrategy !== void 0 ? sortingStrategy : utxo_1.DEFAULT_SORTING_STRATEGY,
|
|
198
201
|
});
|
|
199
202
|
await composer.init(blockchain);
|
|
200
203
|
const hasFunds = composer.composeAllFeeLevels();
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
6
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
7
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
8
|
const events_1 = require("../../../events");
|
|
8
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
9
9
|
const types_1 = require("../../../types");
|
|
10
10
|
class EosGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
11
11
|
init() {
|
|
12
12
|
this.requiredPermissions = ['read'];
|
|
13
|
+
this.requiredDeviceCapabilities = ['Capability_EOS'];
|
|
13
14
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('EOS'), this.firmwareRange);
|
|
14
15
|
this.hasBundle = !!this.payload.bundle;
|
|
15
16
|
const payload = !this.payload.bundle
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
6
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
7
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
8
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
9
|
const helper = tslib_1.__importStar(require("../eosSignTx"));
|
|
9
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
10
|
const eos_1 = require("../../../types/api/eos");
|
|
11
11
|
class EosSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
12
12
|
init() {
|
|
13
13
|
this.requiredPermissions = ['read', 'write'];
|
|
14
|
+
this.requiredDeviceCapabilities = ['Capability_EOS'];
|
|
14
15
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('EOS'), this.firmwareRange);
|
|
15
16
|
const { payload } = this;
|
|
16
17
|
(0, schema_utils_1.AssertWeak)(eos_1.EosSignTransaction, payload);
|
|
@@ -32,8 +32,8 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
32
32
|
name: string;
|
|
33
33
|
owner: {
|
|
34
34
|
keys: {
|
|
35
|
-
address_n?: number[] | undefined;
|
|
36
35
|
type?: number | undefined;
|
|
36
|
+
address_n?: number[] | undefined;
|
|
37
37
|
weight: number;
|
|
38
38
|
key: string;
|
|
39
39
|
}[];
|
|
@@ -53,8 +53,8 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
53
53
|
creator: string;
|
|
54
54
|
active: {
|
|
55
55
|
keys: {
|
|
56
|
-
address_n?: number[] | undefined;
|
|
57
56
|
type?: number | undefined;
|
|
57
|
+
address_n?: number[] | undefined;
|
|
58
58
|
weight: number;
|
|
59
59
|
key: string;
|
|
60
60
|
}[];
|
|
@@ -125,8 +125,8 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
125
125
|
parent: string;
|
|
126
126
|
auth: {
|
|
127
127
|
keys: {
|
|
128
|
-
address_n?: number[] | undefined;
|
|
129
128
|
type?: number | undefined;
|
|
129
|
+
address_n?: number[] | undefined;
|
|
130
130
|
weight: number;
|
|
131
131
|
key: string;
|
|
132
132
|
}[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
@@ -9,7 +10,6 @@ const formatUtils_1 = require("../../../utils/formatUtils");
|
|
|
9
10
|
const constants_1 = require("../../../constants");
|
|
10
11
|
const events_1 = require("../../../events");
|
|
11
12
|
const ethereumDefinitions_1 = require("../ethereumDefinitions");
|
|
12
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
13
13
|
const types_1 = require("../../../types");
|
|
14
14
|
const getAddress_1 = require("../../../types/api/getAddress");
|
|
15
15
|
class EthereumGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
@@ -20,6 +20,7 @@ class EthereumGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
20
20
|
init() {
|
|
21
21
|
this.noBackupConfirmationMode = 'always';
|
|
22
22
|
this.requiredPermissions = ['read'];
|
|
23
|
+
this.requiredDeviceCapabilities = ['Capability_Ethereum'];
|
|
23
24
|
this.hasBundle = !!this.payload.bundle;
|
|
24
25
|
const payload = !this.payload.bundle
|
|
25
26
|
? { ...this.payload, bundle: [this.payload] }
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
6
7
|
const ethereumUtils_1 = require("../../../utils/ethereumUtils");
|
|
7
8
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
8
9
|
const events_1 = require("../../../events");
|
|
9
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
10
|
const types_1 = require("../../../types");
|
|
11
11
|
class EthereumGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
12
12
|
init() {
|
|
13
13
|
this.requiredPermissions = ['read'];
|
|
14
|
+
this.requiredDeviceCapabilities = ['Capability_Ethereum'];
|
|
14
15
|
this.hasBundle = !!this.payload.bundle;
|
|
15
16
|
const payload = !this.payload.bundle
|
|
16
17
|
? { ...this.payload, bundle: [this.payload] }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { MessagesSchema } from '@trezor/protobuf';
|
|
1
2
|
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
3
|
import type { PROTO } from '../../../constants';
|
|
3
4
|
import { EthereumNetworkInfo } from '../../../types';
|
|
4
|
-
import { MessagesSchema } from '@trezor/protobuf';
|
|
5
5
|
type Params = PROTO.EthereumSignMessage & {
|
|
6
6
|
network?: EthereumNetworkInfo;
|
|
7
7
|
definitions?: MessagesSchema.EthereumDefinitions;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
@@ -8,10 +9,10 @@ const ethereumUtils_1 = require("../../../utils/ethereumUtils");
|
|
|
8
9
|
const formatUtils_1 = require("../../../utils/formatUtils");
|
|
9
10
|
const ethereumDefinitions_1 = require("../ethereumDefinitions");
|
|
10
11
|
const types_1 = require("../../../types");
|
|
11
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
12
12
|
class EthereumSignMessage extends AbstractMethod_1.AbstractMethod {
|
|
13
13
|
init() {
|
|
14
14
|
this.requiredPermissions = ['read', 'write'];
|
|
15
|
+
this.requiredDeviceCapabilities = ['Capability_Ethereum'];
|
|
15
16
|
const { payload } = this;
|
|
16
17
|
(0, schema_utils_1.Assert)(types_1.EthereumSignMessage, payload);
|
|
17
18
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { MessagesSchema } from '@trezor/protobuf';
|
|
1
2
|
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
3
|
import type { EthereumTransaction, EthereumTransactionEIP1559 } from '../../../types/api/ethereum';
|
|
3
4
|
import { EthereumNetworkInfo } from '../../../types';
|
|
4
|
-
import { MessagesSchema } from '@trezor/protobuf';
|
|
5
5
|
type Params = {
|
|
6
6
|
path: number[];
|
|
7
7
|
network?: EthereumNetworkInfo;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
6
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
7
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
@@ -10,7 +11,6 @@ const formatUtils_1 = require("../../../utils/formatUtils");
|
|
|
10
11
|
const helper = tslib_1.__importStar(require("../ethereumSignTx"));
|
|
11
12
|
const ethereumDefinitions_1 = require("../ethereumDefinitions");
|
|
12
13
|
const types_1 = require("../../../types");
|
|
13
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
14
14
|
const strip = (0, formatUtils_1.deepTransform)(value => {
|
|
15
15
|
let stripped = (0, formatUtils_1.stripHexPrefix)(value);
|
|
16
16
|
if (stripped.length % 2 !== 0) {
|
|
@@ -21,6 +21,7 @@ const strip = (0, formatUtils_1.deepTransform)(value => {
|
|
|
21
21
|
class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
22
22
|
init() {
|
|
23
23
|
this.requiredPermissions = ['read', 'write'];
|
|
24
|
+
this.requiredDeviceCapabilities = ['Capability_Ethereum'];
|
|
24
25
|
const { payload } = this;
|
|
25
26
|
(0, schema_utils_1.Assert)(types_1.EthereumSignTransaction, payload);
|
|
26
27
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
@@ -60,14 +61,19 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
60
61
|
}
|
|
61
62
|
async run() {
|
|
62
63
|
const { type, tx, definitions, chunkify } = this.params;
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
const isLegacy = type === 'legacy';
|
|
65
|
+
const signature = isLegacy
|
|
66
|
+
? await helper.ethereumSignTx(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, tx.to, tx.value, tx.gasLimit, tx.gasPrice, tx.nonce, tx.chainId, chunkify, tx.data, tx.txType, definitions)
|
|
67
|
+
: await helper.ethereumSignTxEIP1559(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, tx.to, tx.value, tx.gasLimit, tx.maxFeePerGas, tx.maxPriorityFeePerGas, tx.nonce, tx.chainId, chunkify, tx.data, tx.accessList, definitions);
|
|
68
|
+
const txData = {
|
|
67
69
|
...tx,
|
|
68
70
|
...signature,
|
|
69
|
-
type:
|
|
70
|
-
|
|
71
|
+
type: isLegacy ? 0 : 2,
|
|
72
|
+
gasPrice: isLegacy ? tx.gasPrice : null,
|
|
73
|
+
maxFeePerGas: isLegacy ? tx.maxFeePerGas : tx.maxPriorityFeePerGas,
|
|
74
|
+
maxPriorityFeePerGas: !isLegacy ? tx.maxPriorityFeePerGas : undefined,
|
|
75
|
+
};
|
|
76
|
+
const serializedTx = helper.serializeEthereumTx(txData, tx.chainId);
|
|
71
77
|
return { ...signature, serializedTx };
|
|
72
78
|
}
|
|
73
79
|
}
|
|
@@ -1,92 +1,93 @@
|
|
|
1
|
+
import { MessagesSchema } from '@trezor/protobuf';
|
|
1
2
|
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
3
|
import { EthereumSignTypedDataTypes, EthereumSignTypedData as EthereumSignTypedDataParams, EthereumSignTypedHash as EthereumSignTypedHashParams } from '../../../types/api/ethereum';
|
|
3
4
|
import { EthereumNetworkInfo } from '../../../types';
|
|
4
|
-
import { MessagesSchema } from '@trezor/protobuf';
|
|
5
5
|
type Params = (Omit<EthereumSignTypedDataParams<EthereumSignTypedDataTypes>, 'path'> | Omit<EthereumSignTypedHashParams<EthereumSignTypedDataTypes>, 'path'>) & {
|
|
6
6
|
address_n: number[];
|
|
7
7
|
network?: EthereumNetworkInfo;
|
|
8
8
|
definitions?: MessagesSchema.EthereumDefinitions;
|
|
9
9
|
};
|
|
10
|
-
declare const Params: import("@
|
|
10
|
+
declare const Params: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TObject<{
|
|
11
11
|
data: import("@trezor/schema-utils").TObject<{
|
|
12
12
|
types: import("@trezor/schema-utils").TObject<{
|
|
13
|
-
EIP712Domain: import("@
|
|
14
|
-
name: import("@
|
|
15
|
-
type: import("@
|
|
13
|
+
EIP712Domain: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
14
|
+
name: import("@trezor/schema-utils").TString;
|
|
15
|
+
type: import("@trezor/schema-utils").TString;
|
|
16
16
|
}>>;
|
|
17
17
|
}>;
|
|
18
|
-
primaryType: import("@
|
|
18
|
+
primaryType: import("@trezor/schema-utils").TString;
|
|
19
19
|
domain: import("@trezor/schema-utils").TObject<{
|
|
20
|
-
name: import("@
|
|
21
|
-
version: import("@
|
|
22
|
-
chainId: import("@
|
|
23
|
-
verifyingContract: import("@
|
|
24
|
-
salt: import("@
|
|
20
|
+
name: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
21
|
+
version: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
22
|
+
chainId: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TNumber, import("@trezor/schema-utils").TBigInt, import("@trezor/schema-utils").TString]>>;
|
|
23
|
+
verifyingContract: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
24
|
+
salt: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils/lib/custom-types/array-buffer").TArrayBuffer, import("@trezor/schema-utils").TString]>>;
|
|
25
25
|
}>;
|
|
26
26
|
message: import("@trezor/schema-utils").TObject<{}>;
|
|
27
27
|
}>;
|
|
28
|
-
metamask_v4_compat: import("@
|
|
29
|
-
domain_separator_hash: import("@
|
|
30
|
-
message_hash: import("@
|
|
28
|
+
metamask_v4_compat: import("@trezor/schema-utils").TBoolean;
|
|
29
|
+
domain_separator_hash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
|
|
30
|
+
message_hash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
|
|
31
31
|
}>, import("@trezor/schema-utils").TObject<{
|
|
32
32
|
data: import("@trezor/schema-utils").TObject<{
|
|
33
33
|
types: import("@trezor/schema-utils").TObject<{
|
|
34
|
-
EIP712Domain: import("@
|
|
35
|
-
name: import("@
|
|
36
|
-
type: import("@
|
|
34
|
+
EIP712Domain: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
35
|
+
name: import("@trezor/schema-utils").TString;
|
|
36
|
+
type: import("@trezor/schema-utils").TString;
|
|
37
37
|
}>>;
|
|
38
38
|
}>;
|
|
39
|
-
primaryType: import("@
|
|
39
|
+
primaryType: import("@trezor/schema-utils").TString;
|
|
40
40
|
domain: import("@trezor/schema-utils").TObject<{
|
|
41
|
-
name: import("@
|
|
42
|
-
version: import("@
|
|
43
|
-
chainId: import("@
|
|
44
|
-
verifyingContract: import("@
|
|
45
|
-
salt: import("@
|
|
41
|
+
name: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
42
|
+
version: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
43
|
+
chainId: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TNumber, import("@trezor/schema-utils").TBigInt, import("@trezor/schema-utils").TString]>>;
|
|
44
|
+
verifyingContract: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
45
|
+
salt: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils/lib/custom-types/array-buffer").TArrayBuffer, import("@trezor/schema-utils").TString]>>;
|
|
46
46
|
}>;
|
|
47
47
|
message: import("@trezor/schema-utils").TObject<{}>;
|
|
48
48
|
}>;
|
|
49
|
-
metamask_v4_compat: import("@
|
|
50
|
-
domain_separator_hash: import("@
|
|
51
|
-
message_hash: import("@
|
|
49
|
+
metamask_v4_compat: import("@trezor/schema-utils").TBoolean;
|
|
50
|
+
domain_separator_hash: import("@trezor/schema-utils").TString;
|
|
51
|
+
message_hash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
52
52
|
}>]>, import("@trezor/schema-utils").TObject<{
|
|
53
|
-
address_n: import("@
|
|
54
|
-
network: import("@
|
|
55
|
-
label: import("@
|
|
56
|
-
name: import("@
|
|
57
|
-
shortcut: import("@
|
|
58
|
-
slip44: import("@
|
|
53
|
+
address_n: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>;
|
|
54
|
+
network: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
55
|
+
label: import("@trezor/schema-utils").TString;
|
|
56
|
+
name: import("@trezor/schema-utils").TString;
|
|
57
|
+
shortcut: import("@trezor/schema-utils").TString;
|
|
58
|
+
slip44: import("@trezor/schema-utils").TNumber;
|
|
59
59
|
support: import("@trezor/schema-utils").TObject<{
|
|
60
|
-
connect: import("@
|
|
61
|
-
T1B1: import("@
|
|
62
|
-
T2T1: import("@
|
|
63
|
-
T2B1: import("@
|
|
64
|
-
T3B1: import("@
|
|
65
|
-
T3T1: import("@
|
|
60
|
+
connect: import("@trezor/schema-utils").TBoolean;
|
|
61
|
+
T1B1: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TLiteral<false>]>;
|
|
62
|
+
T2T1: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TLiteral<false>]>;
|
|
63
|
+
T2B1: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TLiteral<false>]>;
|
|
64
|
+
T3B1: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TLiteral<false>]>;
|
|
65
|
+
T3T1: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TLiteral<false>]>;
|
|
66
|
+
T3W1: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TLiteral<false>]>;
|
|
66
67
|
}>;
|
|
67
|
-
decimals: import("@
|
|
68
|
-
blockchainLink: import("@
|
|
69
|
-
type: import("@
|
|
70
|
-
url: import("@
|
|
68
|
+
decimals: import("@trezor/schema-utils").TNumber;
|
|
69
|
+
blockchainLink: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
70
|
+
type: import("@trezor/schema-utils").TString;
|
|
71
|
+
url: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
|
|
71
72
|
}>>;
|
|
72
|
-
blockTime: import("@
|
|
73
|
-
minFee: import("@
|
|
74
|
-
maxFee: import("@
|
|
75
|
-
defaultFees: import("@
|
|
76
|
-
label: import("@
|
|
77
|
-
feePerUnit: import("@
|
|
78
|
-
blocks: import("@
|
|
79
|
-
feeLimit: import("@
|
|
80
|
-
feePerTx: import("@
|
|
73
|
+
blockTime: import("@trezor/schema-utils").TNumber;
|
|
74
|
+
minFee: import("@trezor/schema-utils").TNumber;
|
|
75
|
+
maxFee: import("@trezor/schema-utils").TNumber;
|
|
76
|
+
defaultFees: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
77
|
+
label: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TLiteral<"high">, import("@trezor/schema-utils").TLiteral<"normal">, import("@trezor/schema-utils").TLiteral<"economy">, import("@trezor/schema-utils").TLiteral<"low">, import("@trezor/schema-utils").TLiteral<"custom">]>;
|
|
78
|
+
feePerUnit: import("@trezor/schema-utils").TString;
|
|
79
|
+
blocks: import("@trezor/schema-utils").TNumber;
|
|
80
|
+
feeLimit: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
81
|
+
feePerTx: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
81
82
|
}>>;
|
|
82
83
|
}>, import("@trezor/schema-utils").TObject<{
|
|
83
|
-
type: import("@
|
|
84
|
-
chainId: import("@
|
|
85
|
-
network: import("@
|
|
84
|
+
type: import("@trezor/schema-utils").TLiteral<"ethereum">;
|
|
85
|
+
chainId: import("@trezor/schema-utils").TNumber;
|
|
86
|
+
network: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
|
|
86
87
|
}>]>>;
|
|
87
|
-
definitions: import("@
|
|
88
|
-
encoded_network: import("@
|
|
89
|
-
encoded_token: import("@
|
|
88
|
+
definitions: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
89
|
+
encoded_network: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils/lib/custom-types/array-buffer").TArrayBuffer>;
|
|
90
|
+
encoded_token: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils/lib/custom-types/array-buffer").TArrayBuffer>;
|
|
90
91
|
}>>;
|
|
91
92
|
}>]>;
|
|
92
93
|
export default class EthereumSignTypedData extends AbstractMethod<'ethereumSignTypedData', Params> {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const protobuf_1 = require("@trezor/protobuf");
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
6
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
7
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
@@ -11,8 +13,6 @@ const ethereumSignTypedData_1 = require("../ethereumSignTypedData");
|
|
|
11
13
|
const formatUtils_1 = require("../../../utils/formatUtils");
|
|
12
14
|
const ethereumDefinitions_1 = require("../ethereumDefinitions");
|
|
13
15
|
const types_1 = require("../../../types");
|
|
14
|
-
const protobuf_1 = require("@trezor/protobuf");
|
|
15
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
16
16
|
const Params = schema_utils_1.Type.Intersect([
|
|
17
17
|
schema_utils_1.Type.Union([
|
|
18
18
|
schema_utils_1.Type.Omit(ethereum_1.EthereumSignTypedData, schema_utils_1.Type.Literal('path')),
|
|
@@ -27,6 +27,7 @@ const Params = schema_utils_1.Type.Intersect([
|
|
|
27
27
|
class EthereumSignTypedData extends AbstractMethod_1.AbstractMethod {
|
|
28
28
|
init() {
|
|
29
29
|
this.requiredPermissions = ['read', 'write'];
|
|
30
|
+
this.requiredDeviceCapabilities = ['Capability_Ethereum'];
|
|
30
31
|
const { payload } = this;
|
|
31
32
|
(0, schema_utils_1.Assert)(schema_utils_1.Type.Union([ethereum_1.EthereumSignTypedData, ethereum_1.EthereumSignTypedHash]), payload);
|
|
32
33
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
6
|
const formatUtils_1 = require("../../../utils/formatUtils");
|
|
6
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
7
7
|
const types_1 = require("../../../types");
|
|
8
8
|
class EthereumVerifyMessage extends AbstractMethod_1.AbstractMethod {
|
|
9
9
|
init() {
|
|
10
10
|
this.requiredPermissions = ['read', 'write'];
|
|
11
11
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, this.firmwareRange);
|
|
12
|
+
this.requiredDeviceCapabilities = ['Capability_Ethereum'];
|
|
12
13
|
const { payload } = this;
|
|
13
14
|
(0, schema_utils_1.Assert)(types_1.EthereumVerifyMessage, payload);
|
|
14
15
|
const messageHex = payload.hex
|