@trezor/connect 9.1.11 → 9.2.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/CHANGELOG.md +92 -0
- package/README.md +1 -1
- package/lib/api/binance/api/binanceSignTransaction.d.ts +1 -1
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/bitcoin/Fees.d.ts +2 -2
- package/lib/api/bitcoin/TransactionComposer.d.ts +2 -2
- package/lib/api/bitcoin/refTx.js +3 -4
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
- package/lib/api/cardano/cardanoOutputs.d.ts +1 -1
- package/lib/api/cardano/cardanoTokenBundle.d.ts +2 -2
- package/lib/api/changeLanguage.d.ts +11 -0
- package/lib/api/changeLanguage.js +73 -0
- package/lib/api/common/paramsValidator.js +4 -5
- package/lib/api/eos/eosSignTx.d.ts +57 -57
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +6 -6
- package/lib/api/ethereum/api/ethereumSignMessage.d.ts +2 -2
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +2 -2
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +6 -6
- package/lib/api/ethereum/api/ethereumSignTypedData.js +2 -2
- package/lib/api/ethereum/ethereumDefinitions.d.ts +2 -2
- package/lib/api/ethereum/ethereumSignTx.d.ts +3 -3
- package/lib/api/firmware/getBinary.d.ts +1 -1
- package/lib/api/firmware/getBinary.js +4 -5
- package/lib/api/firmware/modifyFirmware.js +2 -3
- package/lib/api/firmware/uploadFirmware.d.ts +2 -2
- package/lib/api/firmware/verifyAuthenticityProof.js +3 -3
- package/lib/api/getAccountInfo.d.ts +2 -0
- package/lib/api/getCoinInfo.d.ts +19 -19
- package/lib/api/getFeatures.d.ts +11 -11
- package/lib/api/getPublicKey.d.ts +6 -6
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +3 -1
- package/lib/api/nem/nemSignTx.d.ts +14 -14
- package/lib/api/rebootToBootloader.d.ts +2 -1
- package/lib/api/rebootToBootloader.js +10 -1
- package/lib/api/recoveryDevice.d.ts +1 -0
- package/lib/api/recoveryDevice.js +3 -0
- package/lib/api/stellar/stellarSignTx.d.ts +1 -1
- package/lib/api/stellar/stellarSignTx.js +6 -0
- package/lib/api/tezos/tezosSignTx.d.ts +18 -18
- package/lib/backend/BackendManager.d.ts +5 -2
- package/lib/backend/BackendManager.js +54 -20
- package/lib/backend/Blockchain.d.ts +8 -8
- package/lib/backend/Blockchain.js +37 -27
- package/lib/constants/index.d.ts +1 -1
- package/lib/constants/index.js +2 -1
- package/lib/core/AbstractMethod.d.ts +4 -4
- package/lib/core/AbstractMethod.js +23 -22
- package/lib/core/index.d.ts +3 -6
- package/lib/core/index.js +73 -52
- package/lib/core/method.d.ts +1 -3
- package/lib/core/method.native.d.ts +1 -3
- package/lib/data/DataManager.d.ts +2 -2
- package/lib/data/analyticsInfo.d.ts +2 -2
- package/lib/data/coinInfo.d.ts +103 -103
- package/lib/data/coinInfo.js +6 -6
- package/lib/data/config.js +1 -1
- package/lib/data/connectSettings.js +3 -0
- package/lib/data/deviceAuthenticityConfig.js +7 -1
- package/lib/data/firmwareInfo.d.ts +1 -1
- package/lib/data/firmwareInfo.js +14 -12
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +7 -6
- package/lib/device/Device.js +13 -11
- package/lib/device/DeviceCommands.d.ts +7 -7
- package/lib/device/DeviceCommands.js +4 -4
- package/lib/device/DeviceList.d.ts +1 -1
- package/lib/device/DeviceList.js +3 -3
- package/lib/events/blockchain.d.ts +10 -2
- package/lib/events/blockchain.js +1 -0
- package/lib/events/call.d.ts +3 -3
- package/lib/events/core.d.ts +12 -10
- package/lib/events/iframe.d.ts +1 -1
- package/lib/events/popup.d.ts +13 -1
- package/lib/events/ui-promise.d.ts +1 -1
- package/lib/events/ui-request.d.ts +1 -2
- package/lib/events/webextension.d.ts +1 -0
- package/lib/events/webextension.js +1 -0
- package/lib/factory.js +1 -0
- package/lib/index.d.ts +0 -4
- package/lib/index.js +23 -40
- package/lib/types/api/applySettings.d.ts +6 -6
- package/lib/types/api/binance/index.d.ts +10 -10
- package/lib/types/api/cardano/index.d.ts +4 -4
- package/lib/types/api/changeLanguage.d.ts +15 -0
- package/lib/types/api/changeLanguage.js +17 -0
- package/lib/types/api/cipherKeyValue.d.ts +2 -2
- package/lib/types/api/eos/index.d.ts +3 -3
- package/lib/types/api/ethereum/index.d.ts +3 -3
- package/lib/types/api/firmwareUpdate.d.ts +1 -1
- package/lib/types/api/getAddress.d.ts +5 -5
- package/lib/types/api/index.d.ts +2 -0
- package/lib/types/api/nem/index.d.ts +7 -7
- package/lib/types/api/rebootToBootloader.d.ts +2 -2
- package/lib/types/api/recoveryDevice.d.ts +1 -1
- package/lib/types/api/stellar/index.d.ts +169 -146
- package/lib/types/api/stellar/index.js +13 -1
- package/lib/types/device.d.ts +4 -1
- package/lib/types/device.js +2 -2
- package/lib/types/firmware.d.ts +2 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/settings.d.ts +1 -0
- package/lib/utils/assets-browser.d.ts +1 -1
- package/lib/utils/assets.d.ts +3 -1
- package/lib/utils/assets.js +2 -2
- package/lib/utils/deviceFeaturesUtils.js +4 -5
- package/lib/utils/firmwareUtils.js +4 -5
- package/lib/utils/hdnodeUtils.d.ts +3 -3
- package/lib/utils/pathUtils.d.ts +3 -3
- package/lib/utils/promiseUtils.d.ts +0 -1
- package/lib/utils/urlUtils.js +3 -3
- package/package.json +28 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,95 @@
|
|
|
1
|
+
# 9.2.0
|
|
2
|
+
|
|
3
|
+
## @trezor/connect-web npm package
|
|
4
|
+
|
|
5
|
+
Single unified popup manager that for both connect-web and connect-webextension package.
|
|
6
|
+
|
|
7
|
+
- chore(connect-web): add channel descriptors to poup, iframe (d6a054e)
|
|
8
|
+
- chore(connect-web): refactor popupmanager (af1723e)
|
|
9
|
+
- other: 0059145, 5da505b, ee98bb5
|
|
10
|
+
- fix(connect-web): race condition POPUP.HANDSHAKE before IFRAME.CALL (a433f85)
|
|
11
|
+
|
|
12
|
+
## @trezor/connect-webextension npm package
|
|
13
|
+
|
|
14
|
+
This package is now out of beta.
|
|
15
|
+
|
|
16
|
+
- fix(connect-webextension): equalSettings in init, don't focus extension on error (64eb6ec)
|
|
17
|
+
- feat(connect): add CHANNEL_HANDSHAKE_CONFIRM to webextension events (1527034)
|
|
18
|
+
- feat(connect-webextension): emit events for WEBEXTENSION.CHANNEL_HANDSHAKE_CONFIRM (4ab8a8c)
|
|
19
|
+
- test(connect-popup): integrate testing for connect-webextension (06b91ec)
|
|
20
|
+
|
|
21
|
+
## @trezor/connect
|
|
22
|
+
|
|
23
|
+
- feat(connect): device.availableTranslations field (5ac97e7)
|
|
24
|
+
- feat(connect): rebootToBootloader, add params (boot_command, firmware_header, language_data_length) (b0f7487)
|
|
25
|
+
- fix(connect): set min version for rebootToBootloader to correct value (74ad010)
|
|
26
|
+
- chore(connect): improve types of fetch assets util (9d60004)
|
|
27
|
+
- fix(connect): toMessageObject undefined (df55715)
|
|
28
|
+
- feat(connect): add reconnect functionality to BackendManager (9783a9e, 3390bfb, af0599f)
|
|
29
|
+
|
|
30
|
+
## @trezor/connect-explorer and @trezor/connect-popup
|
|
31
|
+
|
|
32
|
+
- feat(connect-explorer): add changeLanguage method (7339a2d)
|
|
33
|
+
- chore(connect-explorer): upgrade markdown-it (087ca01)
|
|
34
|
+
- chore(connect-explorer): update markdown-it-replace-link (0a83011)
|
|
35
|
+
- chore(connect-explorer): remove unused AsyncSelect (94eb3f7)
|
|
36
|
+
- fix(connect): display loading before device acquired (815c69d)
|
|
37
|
+
- fix(connect): display device selection if device unacquired (231410e)
|
|
38
|
+
|
|
39
|
+
## Stellar
|
|
40
|
+
|
|
41
|
+
- feat(connect): add support for StellarClaimClaimableBalanceOp. (51a3e29)
|
|
42
|
+
- chore(connect-plugin-stellar): update stellar libraries (2130437, 714bbbd)
|
|
43
|
+
|
|
44
|
+
## General refactoring
|
|
45
|
+
|
|
46
|
+
- chore: dependencies and monorepo changes (fecd89f, c21d81f, 84bc9b8, 5a6759e, 01e33b7, 00fe229, a7e6879, 004938e, fac6d99, d3f8043, ed1fd3e, 3861846, 9fdccc9, 44fa12a)
|
|
47
|
+
- chore(repo): remove build from protobuf (chore(repo): remove build from protobuf #11288) (11ffd94)
|
|
48
|
+
- chore(repo): remove build:lib for some simple packages (chore(repo): remove build:lib for some simple packages #11276) (7febd10)
|
|
49
|
+
- chore(utils): remove build step requirement from @trezor/utils (chore(utils): remove build step requirement from @trezor/utils #11176) (6cd3d3c)
|
|
50
|
+
- chore(connect-explorer-webextension): delete package - now in connect-explorer/src-webextension (494afc7)
|
|
51
|
+
|
|
52
|
+
## Dependencies update
|
|
53
|
+
|
|
54
|
+
- npm-release: @trezor/blockchain-link 2.1.26
|
|
55
|
+
- npm-release: @trezor/blockchain-link-utils 1.0.15
|
|
56
|
+
- npm-release: @trezor/blockchain-link-types 1.0.14
|
|
57
|
+
- npm-release: @trezor/type-utils 1.0.5
|
|
58
|
+
- npm-release: @trezor/connect-analytics 1.0.13
|
|
59
|
+
- npm-release: @trezor/analytics 1.0.15
|
|
60
|
+
- npm-release: @trezor/connect-common 0.0.29
|
|
61
|
+
- npm-release: @trezor/env-utils 1.0.14
|
|
62
|
+
- npm-release: @trezor/transport 1.1.25
|
|
63
|
+
- npm-release: @trezor/protobuf 1.0.9
|
|
64
|
+
- npm-release: @trezor/schema-utils 1.0.2
|
|
65
|
+
- npm-release: @trezor/protocol 1.0.6
|
|
66
|
+
- npm-release: @trezor/utxo-lib 2.0.7
|
|
67
|
+
- npm-release: @trezor/utils 9.0.22
|
|
68
|
+
- npm-release: @trezor/connect 9.2.0
|
|
69
|
+
|
|
70
|
+
# 9.1.12
|
|
71
|
+
|
|
72
|
+
- chore(connect): add new CA pubkeys and update timestamp (a4ca9b1)
|
|
73
|
+
- chore(connect): improve types, replace any with PassphrasePromptResponse (9a95962)
|
|
74
|
+
- feat: add Polygon (8c569ca)
|
|
75
|
+
- fix(connect-popup): display errors with no code (8b7cbfa)
|
|
76
|
+
- fix(connect-popup): don't show error when no device selected (f246369)
|
|
77
|
+
- fix(connect-ui): tipcontainer bottom margin (bb0379d)
|
|
78
|
+
- refactor(connect): unify message promises (b0d4b11)
|
|
79
|
+
- refactor(connect): remove initAsyncPromise (da48a71)
|
|
80
|
+
- refactor(connect): unify initCore and initTransport (00deffa, 027be4f)
|
|
81
|
+
- refactor(connect): CoreRequestMessage/CoreEventMessage separation (ea3afa2)
|
|
82
|
+
- chore(connect-ui): mirror store to local react state (b587a65)
|
|
83
|
+
- feat(connect): deal with disconnected && preferredDevice (40e9db8, 6e4ddb4)
|
|
84
|
+
- chore(connect): use preferred device from store (d1899e8)
|
|
85
|
+
- chore(connect-common): remove es5 target (fails with TypedEmitter) (0a19580)
|
|
86
|
+
- feat(connect-common): store is event emitter, saves permissions and preferred device (db0e963)
|
|
87
|
+
- feat(connect-common): message channel to allow lazy handshake (79be923)
|
|
88
|
+
- chore(connect-ui): ui changes (dcb8e02, 03c6cc6, 936f6b5, 6b7ed69, 8f9f3e2, 4cc0cd6)
|
|
89
|
+
- fix(libs): changes in libs that should allow compiling connect with typescript option skipLibCheck: false
|
|
90
|
+
- chore(connect): split dev and prod builds. (535dd48)
|
|
91
|
+
- dependencies update: @trezor/blockchain-link, @trezor/blockchain-link-types, @trezor/type-utils, @trezor/analytics, @trezor/connect-common, @trezor/env-utils, @trezor/transport, @trezor/protobuf, @trezor/utxo-lib, @trezor/utils
|
|
92
|
+
|
|
1
93
|
# 9.1.11
|
|
2
94
|
|
|
3
95
|
- fix(connect): use weak assert in altcoin signTransaction (86b3703279)
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @trezor/connect
|
|
2
2
|
|
|
3
|
-
API version 9.
|
|
3
|
+
API version 9.2.0
|
|
4
4
|
|
|
5
5
|
[](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
|
|
6
6
|
[](https://www.npmjs.org/package/@trezor/connect)
|
|
@@ -81,7 +81,7 @@ export declare const validate: (tx: BinanceSDKTransaction) => {
|
|
|
81
81
|
}))[];
|
|
82
82
|
};
|
|
83
83
|
export declare const signTx: (typedCall: TypedCall, address_n: number[], tx: BinancePreparedTransaction, chunkify?: boolean) => Promise<{
|
|
84
|
-
signature: string;
|
|
85
84
|
public_key: string;
|
|
85
|
+
signature: string;
|
|
86
86
|
}>;
|
|
87
87
|
//# sourceMappingURL=binanceSignTx.d.ts.map
|
|
@@ -10,14 +10,14 @@ export declare class FeeLevels {
|
|
|
10
10
|
loadMisc(blockchain: Blockchain): Promise<{
|
|
11
11
|
feeLimit?: string | undefined;
|
|
12
12
|
feePerTx?: string | undefined;
|
|
13
|
-
label: "
|
|
13
|
+
label: "normal" | "high" | "economy" | "low" | "custom";
|
|
14
14
|
feePerUnit: string;
|
|
15
15
|
blocks: number;
|
|
16
16
|
}[]>;
|
|
17
17
|
load(blockchain: Blockchain): Promise<{
|
|
18
18
|
feeLimit?: string | undefined;
|
|
19
19
|
feePerTx?: string | undefined;
|
|
20
|
-
label: "
|
|
20
|
+
label: "normal" | "high" | "economy" | "low" | "custom";
|
|
21
21
|
feePerUnit: string;
|
|
22
22
|
blocks: number;
|
|
23
23
|
}[]>;
|
|
@@ -29,12 +29,12 @@ export declare class TransactionComposer {
|
|
|
29
29
|
composeCustomFee(fee: string): void;
|
|
30
30
|
getFeeLevelList(): ({
|
|
31
31
|
feePerByte?: undefined;
|
|
32
|
-
name: string;
|
|
33
32
|
fee: "0";
|
|
33
|
+
name: string;
|
|
34
34
|
disabled: true;
|
|
35
35
|
} | {
|
|
36
|
-
name: string;
|
|
37
36
|
fee: string;
|
|
37
|
+
name: string;
|
|
38
38
|
feePerByte: string;
|
|
39
39
|
minutes: number;
|
|
40
40
|
total: string;
|
package/lib/api/bitcoin/refTx.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateReferencedTransactions = exports.transformReferencedTransactions = exports.transformReferencedTransaction = exports.transformOrigTransactions = exports.parseTransactionHexes = exports.getOrigTransactions = exports.getReferencedTransactions = exports.requireReferencedTransactions = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const utxo_lib_1 = require("@trezor/utxo-lib");
|
|
6
|
-
const
|
|
5
|
+
const utils_1 = require("@trezor/utils");
|
|
7
6
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
8
7
|
const errors_1 = require("../../constants/errors");
|
|
9
8
|
const constants_1 = require("../../constants");
|
|
@@ -77,7 +76,7 @@ const parseOutputScript = (output, network) => {
|
|
|
77
76
|
const transformOrigTransaction = (tx, coinInfo, currentInputs, addresses) => {
|
|
78
77
|
const inputsMap = (input, i) => {
|
|
79
78
|
var _a;
|
|
80
|
-
const prev_hash = bufferUtils.reverseBuffer(input.hash).toString('hex');
|
|
79
|
+
const prev_hash = utils_1.bufferUtils.reverseBuffer(input.hash).toString('hex');
|
|
81
80
|
const currentInput = currentInputs.find(inp => inp.prev_hash === prev_hash && inp.prev_index === input.index);
|
|
82
81
|
if (!(currentInput === null || currentInput === void 0 ? void 0 : currentInput.address_n)) {
|
|
83
82
|
throw (0, errors_1.TypedError)('Method_InvalidParameter', `transformOrigTransactions: invalid input at ${tx.getId()} [${i}]`);
|
|
@@ -151,7 +150,7 @@ const transformReferencedTransaction = (tx) => {
|
|
|
151
150
|
const inputsMap = (input) => ({
|
|
152
151
|
prev_index: input.index,
|
|
153
152
|
sequence: input.sequence,
|
|
154
|
-
prev_hash: bufferUtils.reverseBuffer(input.hash).toString('hex'),
|
|
153
|
+
prev_hash: utils_1.bufferUtils.reverseBuffer(input.hash).toString('hex'),
|
|
155
154
|
script_sig: input.script.toString('hex'),
|
|
156
155
|
});
|
|
157
156
|
const binOutputsMap = (output) => ({
|
|
@@ -9,7 +9,7 @@ export default class BlockchainGetCurrentFiatRates extends AbstractMethod<'block
|
|
|
9
9
|
init(): void;
|
|
10
10
|
run(): Promise<{
|
|
11
11
|
ts: number;
|
|
12
|
-
rates: import("@trezor/blockchain-link-types/lib/common").
|
|
12
|
+
rates: import("@trezor/blockchain-link-types/lib/common").FiatRatesLegacy;
|
|
13
13
|
}>;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
@@ -11,7 +11,7 @@ export default class BlockchainGetFiatRatesForTimestamps extends AbstractMethod<
|
|
|
11
11
|
run(): Promise<{
|
|
12
12
|
tickers: {
|
|
13
13
|
ts: number;
|
|
14
|
-
rates: import("@trezor/blockchain-link-types/lib/common").
|
|
14
|
+
rates: import("@trezor/blockchain-link-types/lib/common").FiatRatesLegacy;
|
|
15
15
|
}[];
|
|
16
16
|
}>;
|
|
17
17
|
}
|
|
@@ -8,7 +8,7 @@ export type OutputWithData = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const OutputValidation: import("@sinclair/typebox").TObject<{
|
|
10
10
|
address: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
|
-
amount: import("@trezor/schema-utils/
|
|
11
|
+
amount: import("@trezor/schema-utils/src/custom-types/uint").TUint;
|
|
12
12
|
tokenBundle: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
13
13
|
policyId: import("@sinclair/typebox").TString;
|
|
14
14
|
tokenAmounts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
@@ -5,8 +5,8 @@ export declare const AssetGroupWithTokens: import("@sinclair/typebox").TObject<{
|
|
|
5
5
|
policyId: import("@sinclair/typebox").TString;
|
|
6
6
|
tokens: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
7
7
|
asset_name_bytes: import("@sinclair/typebox").TString;
|
|
8
|
-
amount: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils/
|
|
9
|
-
mint_amount: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils/
|
|
8
|
+
amount: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils/src/custom-types/uint").TUint>;
|
|
9
|
+
mint_amount: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils/src/custom-types/uint").TUint>;
|
|
10
10
|
}>>;
|
|
11
11
|
}>;
|
|
12
12
|
export declare const tokenBundleToProto: (tokenBundle: CardanoAssetGroup[]) => AssetGroupWithTokens[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import { ChangeLanguage as ChangeLanguageSchema } from '../types/api/changeLanguage';
|
|
3
|
+
export default class ChangeLanguage extends AbstractMethod<'changeLanguage', ChangeLanguageSchema> {
|
|
4
|
+
init(): void;
|
|
5
|
+
confirmation(): Promise<boolean>;
|
|
6
|
+
private uploadTranslationData;
|
|
7
|
+
run(): Promise<{
|
|
8
|
+
message: string;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=changeLanguage.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const events_1 = require("../events");
|
|
6
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
7
|
+
const changeLanguage_1 = require("../types/api/changeLanguage");
|
|
8
|
+
const assets_1 = require("../utils/assets");
|
|
9
|
+
class ChangeLanguage extends AbstractMethod_1.AbstractMethod {
|
|
10
|
+
init() {
|
|
11
|
+
this.useEmptyPassphrase = true;
|
|
12
|
+
this.requiredPermissions = ['management'];
|
|
13
|
+
this.useDeviceState = false;
|
|
14
|
+
const { payload } = this;
|
|
15
|
+
(0, schema_utils_1.Assert)(changeLanguage_1.ChangeLanguage, payload);
|
|
16
|
+
if (payload.binary) {
|
|
17
|
+
this.params = {
|
|
18
|
+
binary: payload.binary,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this.params = {
|
|
23
|
+
language: payload.language,
|
|
24
|
+
baseUrl: payload.baseUrl || 'https://data.trezor.io',
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async confirmation() {
|
|
29
|
+
await this.getPopupPromise().promise;
|
|
30
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
31
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
32
|
+
view: 'device-management',
|
|
33
|
+
customConfirmButton: {
|
|
34
|
+
className: 'confirm',
|
|
35
|
+
label: 'Proceed',
|
|
36
|
+
},
|
|
37
|
+
label: 'Do you want to change language?',
|
|
38
|
+
}));
|
|
39
|
+
const uiResp = await uiPromise.promise;
|
|
40
|
+
return uiResp.payload;
|
|
41
|
+
}
|
|
42
|
+
async uploadTranslationData(payload) {
|
|
43
|
+
const length = payload.byteLength;
|
|
44
|
+
if (!this.device.commands) {
|
|
45
|
+
throw constants_1.ERRORS.TypedError('Runtime', 'uploadTranslationData: device.commands is not set');
|
|
46
|
+
}
|
|
47
|
+
let response = await this.device.commands.typedCall('ChangeLanguage', ['TranslationDataRequest', 'Success'], {
|
|
48
|
+
data_length: length,
|
|
49
|
+
});
|
|
50
|
+
while (response.type !== 'Success') {
|
|
51
|
+
const start = response.message.data_offset;
|
|
52
|
+
const end = response.message.data_offset + response.message.data_length;
|
|
53
|
+
const chunk = payload.slice(start, end);
|
|
54
|
+
response = await this.device.commands.typedCall('TranslationDataAck', ['TranslationDataRequest', 'Success'], {
|
|
55
|
+
data_chunk: Buffer.from(chunk).toString('hex'),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return response.message;
|
|
59
|
+
}
|
|
60
|
+
async run() {
|
|
61
|
+
const { language, binary, baseUrl } = this.params;
|
|
62
|
+
if (binary) {
|
|
63
|
+
return this.uploadTranslationData(binary);
|
|
64
|
+
}
|
|
65
|
+
const version = this.device.getVersion().join('.');
|
|
66
|
+
const model = this.device.features.internal_model;
|
|
67
|
+
const url = `${baseUrl}/data/translations/translation-${model}-${language}-${version}-unsigned.bin`;
|
|
68
|
+
const downloadedBinary = await (0, assets_1.httpRequest)(url, 'binary');
|
|
69
|
+
return this.uploadTranslationData(downloadedBinary);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.default = ChangeLanguage;
|
|
73
|
+
//# sourceMappingURL=changeLanguage.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFirmwareRange = exports.validateCoinPath = exports.validateParams = void 0;
|
|
4
|
-
const
|
|
5
|
-
const versionUtils = tslib_1.__importStar(require("@trezor/utils/lib/versionUtils"));
|
|
4
|
+
const utils_1 = require("@trezor/utils");
|
|
6
5
|
const constants_1 = require("../../constants");
|
|
7
6
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
8
7
|
const config_1 = require("../../data/config");
|
|
@@ -79,7 +78,7 @@ const getFirmwareRange = (method, coinInfo, currentRange) => {
|
|
|
79
78
|
}
|
|
80
79
|
else if (range[model].min !== '0' &&
|
|
81
80
|
typeof supportVersion === 'string' &&
|
|
82
|
-
versionUtils.isNewer(supportVersion, range[model].min)) {
|
|
81
|
+
utils_1.versionUtils.isNewer(supportVersion, range[model].min)) {
|
|
83
82
|
range[model].min = supportVersion;
|
|
84
83
|
}
|
|
85
84
|
});
|
|
@@ -112,7 +111,7 @@ const getFirmwareRange = (method, coinInfo, currentRange) => {
|
|
|
112
111
|
if (modelMin) {
|
|
113
112
|
if (modelMin === '0' ||
|
|
114
113
|
range[model].min === '0' ||
|
|
115
|
-
!versionUtils.isNewerOrEqual(range[model].min, modelMin)) {
|
|
114
|
+
!utils_1.versionUtils.isNewerOrEqual(range[model].min, modelMin)) {
|
|
116
115
|
range[model].min = modelMin;
|
|
117
116
|
}
|
|
118
117
|
}
|
|
@@ -124,7 +123,7 @@ const getFirmwareRange = (method, coinInfo, currentRange) => {
|
|
|
124
123
|
if (modelMax) {
|
|
125
124
|
if (modelMax === '0' ||
|
|
126
125
|
range[model].max === '0' ||
|
|
127
|
-
!versionUtils.isNewerOrEqual(range[model].max, modelMax)) {
|
|
126
|
+
!utils_1.versionUtils.isNewerOrEqual(range[model].max, modelMax)) {
|
|
128
127
|
range[model].max = modelMax;
|
|
129
128
|
}
|
|
130
129
|
}
|
|
@@ -21,59 +21,7 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
21
21
|
sender: string;
|
|
22
22
|
receiver: string;
|
|
23
23
|
} | undefined;
|
|
24
|
-
refund?: {
|
|
25
|
-
owner: string;
|
|
26
|
-
} | undefined;
|
|
27
|
-
unknown?: {
|
|
28
|
-
data_size: number;
|
|
29
|
-
data_chunk: string;
|
|
30
|
-
} | undefined;
|
|
31
|
-
new_account?: {
|
|
32
|
-
name: string;
|
|
33
|
-
owner: {
|
|
34
|
-
keys: {
|
|
35
|
-
type?: number | undefined;
|
|
36
|
-
address_n?: number[] | undefined;
|
|
37
|
-
weight: number;
|
|
38
|
-
key: string;
|
|
39
|
-
}[];
|
|
40
|
-
threshold: number;
|
|
41
|
-
accounts: {
|
|
42
|
-
weight: number;
|
|
43
|
-
account: {
|
|
44
|
-
permission: string;
|
|
45
|
-
actor: string;
|
|
46
|
-
};
|
|
47
|
-
}[];
|
|
48
|
-
waits: {
|
|
49
|
-
weight: number;
|
|
50
|
-
wait_sec: number;
|
|
51
|
-
}[];
|
|
52
|
-
};
|
|
53
|
-
creator: string;
|
|
54
|
-
active: {
|
|
55
|
-
keys: {
|
|
56
|
-
type?: number | undefined;
|
|
57
|
-
address_n?: number[] | undefined;
|
|
58
|
-
weight: number;
|
|
59
|
-
key: string;
|
|
60
|
-
}[];
|
|
61
|
-
threshold: number;
|
|
62
|
-
accounts: {
|
|
63
|
-
weight: number;
|
|
64
|
-
account: {
|
|
65
|
-
permission: string;
|
|
66
|
-
actor: string;
|
|
67
|
-
};
|
|
68
|
-
}[];
|
|
69
|
-
waits: {
|
|
70
|
-
weight: number;
|
|
71
|
-
wait_sec: number;
|
|
72
|
-
}[];
|
|
73
|
-
};
|
|
74
|
-
} | undefined;
|
|
75
24
|
delegate?: {
|
|
76
|
-
transfer: boolean;
|
|
77
25
|
sender: string;
|
|
78
26
|
receiver: string;
|
|
79
27
|
net_quantity: {
|
|
@@ -84,6 +32,7 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
84
32
|
symbol: string;
|
|
85
33
|
amount: string | number;
|
|
86
34
|
};
|
|
35
|
+
transfer: boolean;
|
|
87
36
|
} | undefined;
|
|
88
37
|
undelegate?: {
|
|
89
38
|
sender: string;
|
|
@@ -97,6 +46,9 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
97
46
|
amount: string | number;
|
|
98
47
|
};
|
|
99
48
|
} | undefined;
|
|
49
|
+
refund?: {
|
|
50
|
+
owner: string;
|
|
51
|
+
} | undefined;
|
|
100
52
|
buy_ram?: {
|
|
101
53
|
quantity: {
|
|
102
54
|
symbol: string;
|
|
@@ -134,8 +86,8 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
134
86
|
accounts: {
|
|
135
87
|
weight: number;
|
|
136
88
|
account: {
|
|
137
|
-
permission: string;
|
|
138
89
|
actor: string;
|
|
90
|
+
permission: string;
|
|
139
91
|
};
|
|
140
92
|
}[];
|
|
141
93
|
waits: {
|
|
@@ -150,21 +102,69 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
150
102
|
} | undefined;
|
|
151
103
|
link_auth?: {
|
|
152
104
|
type: string;
|
|
153
|
-
account: string;
|
|
154
105
|
code: string;
|
|
106
|
+
account: string;
|
|
155
107
|
requirement: string;
|
|
156
108
|
} | undefined;
|
|
157
109
|
unlink_auth?: {
|
|
158
110
|
type: string;
|
|
159
|
-
account: string;
|
|
160
111
|
code: string;
|
|
112
|
+
account: string;
|
|
161
113
|
} | undefined;
|
|
162
|
-
|
|
114
|
+
new_account?: {
|
|
163
115
|
name: string;
|
|
116
|
+
owner: {
|
|
117
|
+
keys: {
|
|
118
|
+
type?: number | undefined;
|
|
119
|
+
address_n?: number[] | undefined;
|
|
120
|
+
weight: number;
|
|
121
|
+
key: string;
|
|
122
|
+
}[];
|
|
123
|
+
threshold: number;
|
|
124
|
+
accounts: {
|
|
125
|
+
weight: number;
|
|
126
|
+
account: {
|
|
127
|
+
actor: string;
|
|
128
|
+
permission: string;
|
|
129
|
+
};
|
|
130
|
+
}[];
|
|
131
|
+
waits: {
|
|
132
|
+
weight: number;
|
|
133
|
+
wait_sec: number;
|
|
134
|
+
}[];
|
|
135
|
+
};
|
|
136
|
+
creator: string;
|
|
137
|
+
active: {
|
|
138
|
+
keys: {
|
|
139
|
+
type?: number | undefined;
|
|
140
|
+
address_n?: number[] | undefined;
|
|
141
|
+
weight: number;
|
|
142
|
+
key: string;
|
|
143
|
+
}[];
|
|
144
|
+
threshold: number;
|
|
145
|
+
accounts: {
|
|
146
|
+
weight: number;
|
|
147
|
+
account: {
|
|
148
|
+
actor: string;
|
|
149
|
+
permission: string;
|
|
150
|
+
};
|
|
151
|
+
}[];
|
|
152
|
+
waits: {
|
|
153
|
+
weight: number;
|
|
154
|
+
wait_sec: number;
|
|
155
|
+
}[];
|
|
156
|
+
};
|
|
157
|
+
} | undefined;
|
|
158
|
+
unknown?: {
|
|
159
|
+
data_size: number;
|
|
160
|
+
data_chunk: string;
|
|
161
|
+
} | undefined;
|
|
162
|
+
common: {
|
|
164
163
|
account: string;
|
|
164
|
+
name: string;
|
|
165
165
|
authorization: {
|
|
166
|
-
permission: string;
|
|
167
166
|
actor: string;
|
|
167
|
+
permission: string;
|
|
168
168
|
}[];
|
|
169
169
|
};
|
|
170
170
|
}[];
|
|
@@ -13,23 +13,23 @@ export default class EthereumGetPublicKey extends AbstractMethod<'ethereumGetPub
|
|
|
13
13
|
run(): Promise<{
|
|
14
14
|
xpubSegwit?: string | undefined;
|
|
15
15
|
path: number[];
|
|
16
|
-
publicKey: string;
|
|
17
|
-
serializedPath: string;
|
|
18
16
|
depth: number;
|
|
19
17
|
fingerprint: number;
|
|
18
|
+
xpub: string;
|
|
19
|
+
publicKey: string;
|
|
20
|
+
serializedPath: string;
|
|
20
21
|
chainCode: string;
|
|
21
22
|
childNum: number;
|
|
22
|
-
xpub: string;
|
|
23
23
|
} | {
|
|
24
24
|
xpubSegwit?: string | undefined;
|
|
25
25
|
path: number[];
|
|
26
|
-
publicKey: string;
|
|
27
|
-
serializedPath: string;
|
|
28
26
|
depth: number;
|
|
29
27
|
fingerprint: number;
|
|
28
|
+
xpub: string;
|
|
29
|
+
publicKey: string;
|
|
30
|
+
serializedPath: string;
|
|
30
31
|
chainCode: string;
|
|
31
32
|
childNum: number;
|
|
32
|
-
xpub: string;
|
|
33
33
|
}[]>;
|
|
34
34
|
}
|
|
35
35
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
2
|
import type { PROTO } from '../../../constants';
|
|
3
3
|
import { EthereumNetworkInfo } from '../../../types';
|
|
4
|
-
import
|
|
4
|
+
import { MessagesSchema } from '@trezor/protobuf';
|
|
5
5
|
type Params = PROTO.EthereumSignMessage & {
|
|
6
6
|
network?: EthereumNetworkInfo;
|
|
7
|
-
definitions?: EthereumDefinitions;
|
|
7
|
+
definitions?: MessagesSchema.EthereumDefinitions;
|
|
8
8
|
};
|
|
9
9
|
export default class EthereumSignMessage extends AbstractMethod<'ethereumSignMessage', Params> {
|
|
10
10
|
init(): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
2
|
import type { EthereumTransaction, EthereumTransactionEIP1559 } from '../../../types/api/ethereum';
|
|
3
3
|
import { EthereumNetworkInfo } from '../../../types';
|
|
4
|
-
import
|
|
4
|
+
import { MessagesSchema } from '@trezor/protobuf';
|
|
5
5
|
type Params = {
|
|
6
6
|
path: number[];
|
|
7
7
|
network?: EthereumNetworkInfo;
|
|
8
|
-
definitions?: EthereumDefinitions;
|
|
8
|
+
definitions?: MessagesSchema.EthereumDefinitions;
|
|
9
9
|
chunkify: boolean;
|
|
10
10
|
} & ({
|
|
11
11
|
type: 'legacy';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
2
|
import { EthereumSignTypedDataTypes, EthereumSignTypedData as EthereumSignTypedDataParams, EthereumSignTypedHash as EthereumSignTypedHashParams } from '../../../types/api/ethereum';
|
|
3
3
|
import { EthereumNetworkInfo } from '../../../types';
|
|
4
|
-
import {
|
|
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
|
-
definitions?: EthereumDefinitions;
|
|
8
|
+
definitions?: MessagesSchema.EthereumDefinitions;
|
|
9
9
|
};
|
|
10
10
|
declare const Params: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
11
11
|
data: import("@sinclair/typebox").TObject<{
|
|
@@ -21,7 +21,7 @@ declare const Params: import("@sinclair/typebox").TIntersect<[import("@sinclair/
|
|
|
21
21
|
version: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
22
22
|
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>>;
|
|
23
23
|
verifyingContract: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
24
|
-
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@trezor/schema-utils/
|
|
24
|
+
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@trezor/schema-utils/src/custom-types/array-buffer").TArrayBuffer, import("@sinclair/typebox").TString]>>;
|
|
25
25
|
}>;
|
|
26
26
|
message: import("@sinclair/typebox").TObject<{}>;
|
|
27
27
|
}>;
|
|
@@ -42,7 +42,7 @@ declare const Params: import("@sinclair/typebox").TIntersect<[import("@sinclair/
|
|
|
42
42
|
version: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
43
43
|
chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>>;
|
|
44
44
|
verifyingContract: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
45
|
-
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@trezor/schema-utils/
|
|
45
|
+
salt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@trezor/schema-utils/src/custom-types/array-buffer").TArrayBuffer, import("@sinclair/typebox").TString]>>;
|
|
46
46
|
}>;
|
|
47
47
|
message: import("@sinclair/typebox").TObject<{}>;
|
|
48
48
|
}>;
|
|
@@ -83,8 +83,8 @@ declare const Params: import("@sinclair/typebox").TIntersect<[import("@sinclair/
|
|
|
83
83
|
network: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
|
|
84
84
|
}>]>>;
|
|
85
85
|
definitions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
86
|
-
encoded_network: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils/
|
|
87
|
-
encoded_token: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils/
|
|
86
|
+
encoded_network: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils/src/custom-types/array-buffer").TArrayBuffer>;
|
|
87
|
+
encoded_token: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils/src/custom-types/array-buffer").TArrayBuffer>;
|
|
88
88
|
}>>;
|
|
89
89
|
}>]>;
|
|
90
90
|
export default class EthereumSignTypedData extends AbstractMethod<'ethereumSignTypedData', Params> {
|
|
@@ -11,7 +11,7 @@ const ethereumSignTypedData_1 = require("../ethereumSignTypedData");
|
|
|
11
11
|
const formatUtils_1 = require("../../../utils/formatUtils");
|
|
12
12
|
const ethereumDefinitions_1 = require("../ethereumDefinitions");
|
|
13
13
|
const types_1 = require("../../../types");
|
|
14
|
-
const
|
|
14
|
+
const protobuf_1 = require("@trezor/protobuf");
|
|
15
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([
|
|
@@ -21,7 +21,7 @@ const Params = schema_utils_1.Type.Intersect([
|
|
|
21
21
|
schema_utils_1.Type.Object({
|
|
22
22
|
address_n: schema_utils_1.Type.Array(schema_utils_1.Type.Number()),
|
|
23
23
|
network: schema_utils_1.Type.Optional(types_1.EthereumNetworkInfo),
|
|
24
|
-
definitions: schema_utils_1.Type.Optional(
|
|
24
|
+
definitions: schema_utils_1.Type.Optional(protobuf_1.MessagesSchema.EthereumDefinitions),
|
|
25
25
|
}),
|
|
26
26
|
]);
|
|
27
27
|
class EthereumSignTypedData extends AbstractMethod_1.AbstractMethod {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MessagesSchema } from '@trezor/protobuf';
|
|
2
2
|
import { EthereumNetworkInfo } from '../../types';
|
|
3
3
|
import { Static } from '@trezor/schema-utils';
|
|
4
4
|
interface GetEthereumDefinitions {
|
|
@@ -41,7 +41,7 @@ export declare const EthereumDefinitionDecoded: import("@sinclair/typebox").TObj
|
|
|
41
41
|
symbol: import("@sinclair/typebox").TString;
|
|
42
42
|
}>>;
|
|
43
43
|
}>;
|
|
44
|
-
export declare const decodeEthereumDefinition: (encodedDefinition: EthereumDefinitions) => EthereumDefinitionDecoded;
|
|
44
|
+
export declare const decodeEthereumDefinition: (encodedDefinition: MessagesSchema.EthereumDefinitions) => EthereumDefinitionDecoded;
|
|
45
45
|
export declare const ethereumNetworkInfoFromDefinition: (definition: EthereumNetworkDefinitionDecoded) => EthereumNetworkInfo;
|
|
46
46
|
export {};
|
|
47
47
|
//# sourceMappingURL=ethereumDefinitions.d.ts.map
|