@trezor/connect 9.1.6 → 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 +33 -0
- package/README.md +1 -1
- package/lib/api/binance/api/binanceGetAddress.d.ts +1 -1
- package/lib/api/binance/api/binanceGetAddress.js +4 -1
- package/lib/api/binance/api/binanceSignTransaction.d.ts +1 -0
- package/lib/api/binance/api/binanceSignTransaction.js +3 -1
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/binance/binanceSignTx.js +2 -1
- package/lib/api/cardano/api/cardanoGetAddress.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetAddress.js +4 -1
- package/lib/api/cardano/api/cardanoSignTransaction.d.ts +1 -0
- package/lib/api/cardano/api/cardanoSignTransaction.js +3 -0
- package/lib/api/common/paramsValidator.js +5 -3
- package/lib/api/eos/api/eosGetPublicKey.js +2 -0
- package/lib/api/eos/api/eosSignTransaction.d.ts +1 -0
- package/lib/api/eos/api/eosSignTransaction.js +3 -1
- package/lib/api/eos/eosSignTx.d.ts +1 -1
- package/lib/api/eos/eosSignTx.js +2 -1
- package/lib/api/ethereum/api/ethereumGetAddress.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumGetAddress.js +4 -1
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +1 -0
- package/lib/api/ethereum/api/ethereumSignTransaction.js +7 -5
- package/lib/api/ethereum/ethereumSignTx.d.ts +4 -4
- package/lib/api/ethereum/ethereumSignTx.js +4 -2
- package/lib/api/getAddress.d.ts +1 -1
- package/lib/api/getAddress.js +4 -1
- package/lib/api/nem/api/nemGetAddress.d.ts +1 -1
- package/lib/api/nem/api/nemGetAddress.js +4 -1
- package/lib/api/nem/api/nemSignTransaction.js +2 -1
- package/lib/api/nem/nemSignTx.d.ts +1 -1
- package/lib/api/nem/nemSignTx.js +2 -1
- package/lib/api/ripple/api/rippleGetAddress.d.ts +1 -1
- package/lib/api/ripple/api/rippleGetAddress.js +4 -1
- package/lib/api/ripple/api/rippleSignTransaction.js +3 -1
- 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/solanaGetAddress.d.ts +1 -1
- package/lib/api/solana/api/solanaGetAddress.js +4 -2
- package/lib/api/solana/api/solanaGetPublicKey.js +1 -2
- package/lib/api/solana/api/solanaSignTransaction.js +2 -1
- package/lib/api/stellar/api/stellarGetAddress.d.ts +1 -1
- package/lib/api/stellar/api/stellarGetAddress.js +4 -1
- package/lib/api/tezos/api/tezosGetAddress.d.ts +1 -1
- package/lib/api/tezos/api/tezosGetAddress.js +4 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +2 -0
- package/lib/api/tezos/tezosSignTx.d.ts +1 -1
- package/lib/api/tezos/tezosSignTx.js +2 -1
- package/lib/backend/Blockchain.js +1 -0
- package/lib/core/AbstractMethod.js +3 -0
- package/lib/data/DataManager.d.ts +11 -0
- package/lib/data/config.d.ts +11 -0
- package/lib/data/config.js +9 -2
- package/lib/data/defaultFeeLevels.js +1 -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 +2 -0
- package/lib/device/Device.js +12 -2
- package/lib/device/DeviceCommands.d.ts +2 -2
- package/lib/device/DeviceCommands.js +10 -3
- package/lib/events/ui-request.d.ts +1 -1
- 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/eos/index.d.ts +1 -0
- package/lib/types/api/ethereum/index.d.ts +1 -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 +10 -0
- package/lib/types/api/tezos/index.d.ts +1 -0
- package/lib/types/coinInfo.d.ts +3 -3
- package/lib/types/device.d.ts +1 -1
- package/lib/types/params.d.ts +3 -0
- package/lib/utils/debug.d.ts +5 -1
- package/lib/utils/debug.js +7 -6
- package/lib/utils/deviceFeaturesUtils.js +6 -5
- package/package.json +14 -15
|
@@ -12,9 +12,10 @@ class RippleSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
12
12
|
(0, paramsValidator_1.validateParams)(payload, [
|
|
13
13
|
{ name: 'path', required: true },
|
|
14
14
|
{ name: 'transaction', required: true },
|
|
15
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
15
16
|
]);
|
|
16
17
|
const path = (0, pathUtils_1.validatePath)(payload.path, 5);
|
|
17
|
-
const { transaction } = payload;
|
|
18
|
+
const { transaction, chunkify } = payload;
|
|
18
19
|
(0, paramsValidator_1.validateParams)(transaction, [
|
|
19
20
|
{ name: 'fee', type: 'uint' },
|
|
20
21
|
{ name: 'flags', type: 'number' },
|
|
@@ -38,6 +39,7 @@ class RippleSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
38
39
|
destination: transaction.payment.destination,
|
|
39
40
|
destination_tag: transaction.payment.destinationTag,
|
|
40
41
|
},
|
|
42
|
+
chunkify: typeof chunkify === 'boolean' ? chunkify : false,
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
45
|
get info() {
|
|
@@ -35,6 +35,7 @@ class SignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
35
35
|
{ name: 'amountUnit', type: ['number', 'string'] },
|
|
36
36
|
{ name: 'unlockPath', type: 'object' },
|
|
37
37
|
{ name: 'serialize', type: 'boolean' },
|
|
38
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
38
39
|
]);
|
|
39
40
|
if (payload.unlockPath) {
|
|
40
41
|
(0, paramsValidator_1.validateParams)(payload.unlockPath, [
|
|
@@ -86,6 +87,7 @@ class SignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
86
87
|
amount_unit: payload.amountUnit,
|
|
87
88
|
serialize: payload.serialize,
|
|
88
89
|
coinjoin_request: payload.coinjoinRequest,
|
|
90
|
+
chunkify: typeof payload.chunkify === 'boolean' ? payload.chunkify : false,
|
|
89
91
|
},
|
|
90
92
|
coinInfo,
|
|
91
93
|
push: typeof payload.push === 'boolean' ? payload.push : false,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SolanaTxAdditionalInfo } from '../../types/api/solana';
|
|
2
|
+
export declare const transformAdditionalInfo: (additionalInfo?: SolanaTxAdditionalInfo) => {
|
|
3
|
+
token_accounts_infos: {
|
|
4
|
+
base_address: string;
|
|
5
|
+
token_program: string;
|
|
6
|
+
token_mint: string;
|
|
7
|
+
token_account: string;
|
|
8
|
+
}[];
|
|
9
|
+
} | undefined;
|
|
10
|
+
//# sourceMappingURL=additionalInfo.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformAdditionalInfo = void 0;
|
|
4
|
+
const paramsValidator_1 = require("../common/paramsValidator");
|
|
5
|
+
const validateAdditionalInfo = (additionalInfo) => {
|
|
6
|
+
var _a;
|
|
7
|
+
(0, paramsValidator_1.validateParams)(additionalInfo, [{ name: 'tokenAccountsInfos', type: 'array' }]);
|
|
8
|
+
(_a = additionalInfo.tokenAccountsInfos) === null || _a === void 0 ? void 0 : _a.forEach(tokenAccountInfo => {
|
|
9
|
+
(0, paramsValidator_1.validateParams)(tokenAccountInfo, [
|
|
10
|
+
{ name: 'baseAddress', type: 'string', required: true },
|
|
11
|
+
{ name: 'tokenProgram', type: 'string', required: true },
|
|
12
|
+
{ name: 'tokenMint', type: 'string', required: true },
|
|
13
|
+
{ name: 'tokenAccount', type: 'string', required: true },
|
|
14
|
+
]);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
const transformAdditionalInfo = (additionalInfo) => {
|
|
18
|
+
var _a;
|
|
19
|
+
if (!additionalInfo) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
validateAdditionalInfo(additionalInfo);
|
|
23
|
+
return {
|
|
24
|
+
token_accounts_infos: ((_a = additionalInfo.tokenAccountsInfos) === null || _a === void 0 ? void 0 : _a.map(tokenAccountInfo => ({
|
|
25
|
+
base_address: tokenAccountInfo.baseAddress,
|
|
26
|
+
token_program: tokenAccountInfo.tokenProgram,
|
|
27
|
+
token_mint: tokenAccountInfo.tokenMint,
|
|
28
|
+
token_account: tokenAccountInfo.tokenAccount,
|
|
29
|
+
}))) || [],
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.transformAdditionalInfo = transformAdditionalInfo;
|
|
33
|
+
//# sourceMappingURL=additionalInfo.js.map
|
|
@@ -16,7 +16,7 @@ export default class SolanaGetAddress extends AbstractMethod<'solanaGetAddress',
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display }: Params): Promise<PROTO.SolanaAddress>;
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<PROTO.SolanaAddress>;
|
|
20
20
|
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -12,7 +12,6 @@ class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
12
12
|
this.progress = 0;
|
|
13
13
|
}
|
|
14
14
|
init() {
|
|
15
|
-
console.warn('⚠️ BETA: This api is unstable and may change!');
|
|
16
15
|
this.requiredPermissions = ['read'];
|
|
17
16
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
|
|
18
17
|
this.hasBundle = !!this.payload.bundle;
|
|
@@ -25,12 +24,14 @@ class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
25
24
|
{ name: 'path', required: true },
|
|
26
25
|
{ name: 'address', type: 'string' },
|
|
27
26
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
27
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
28
28
|
]);
|
|
29
29
|
const path = (0, pathUtils_1.validatePath)(batch.path, 2);
|
|
30
30
|
return {
|
|
31
31
|
address_n: path,
|
|
32
32
|
address: batch.address,
|
|
33
33
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
34
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
34
35
|
};
|
|
35
36
|
});
|
|
36
37
|
const useEventListener = payload.useEventListener &&
|
|
@@ -84,11 +85,12 @@ class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
84
85
|
const uiResp = await uiPromise.promise;
|
|
85
86
|
return uiResp.payload;
|
|
86
87
|
}
|
|
87
|
-
async _call({ address_n, show_display }) {
|
|
88
|
+
async _call({ address_n, show_display, chunkify }) {
|
|
88
89
|
const cmd = this.device.getCommands();
|
|
89
90
|
const response = await cmd.typedCall('SolanaGetAddress', 'SolanaAddress', {
|
|
90
91
|
address_n,
|
|
91
92
|
show_display,
|
|
93
|
+
chunkify,
|
|
92
94
|
});
|
|
93
95
|
return response.message;
|
|
94
96
|
}
|
|
@@ -7,7 +7,6 @@ const pathUtils_1 = require("../../../utils/pathUtils");
|
|
|
7
7
|
const events_1 = require("../../../events");
|
|
8
8
|
class SolanaGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
9
9
|
init() {
|
|
10
|
-
console.warn('⚠️ BETA: This api is unstable and may change!');
|
|
11
10
|
this.requiredPermissions = ['read'];
|
|
12
11
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
|
|
13
12
|
this.hasBundle = !!this.payload.bundle;
|
|
@@ -54,7 +53,7 @@ class SolanaGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
|
54
53
|
await this.getPopupPromise().promise;
|
|
55
54
|
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
56
55
|
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
57
|
-
view: '
|
|
56
|
+
view: 'no-backup',
|
|
58
57
|
}));
|
|
59
58
|
const uiResp = await uiPromise.promise;
|
|
60
59
|
return uiResp.payload;
|
|
@@ -4,9 +4,9 @@ const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
|
4
4
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
5
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
|
+
const additionalInfo_1 = require("../additionalInfo");
|
|
7
8
|
class SolanaSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
8
9
|
init() {
|
|
9
|
-
console.warn('⚠️ BETA: This api is unstable and may change!');
|
|
10
10
|
this.requiredPermissions = ['read', 'write'];
|
|
11
11
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
|
|
12
12
|
const { payload } = this;
|
|
@@ -18,6 +18,7 @@ class SolanaSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
18
18
|
this.params = {
|
|
19
19
|
address_n: path,
|
|
20
20
|
serialized_tx: payload.serializedTx,
|
|
21
|
+
additional_info: (0, additionalInfo_1.transformAdditionalInfo)(payload.additionalInfo),
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
get info() {
|
|
@@ -16,7 +16,7 @@ export default class StellarGetAddress extends AbstractMethod<'stellarGetAddress
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display }: Params): Promise<PROTO.StellarAddress>;
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<PROTO.StellarAddress>;
|
|
20
20
|
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -27,12 +27,14 @@ class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
27
27
|
{ name: 'path', required: true },
|
|
28
28
|
{ name: 'address', type: 'string' },
|
|
29
29
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
30
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
30
31
|
]);
|
|
31
32
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
32
33
|
return {
|
|
33
34
|
address_n: path,
|
|
34
35
|
address: batch.address,
|
|
35
36
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
37
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
36
38
|
};
|
|
37
39
|
});
|
|
38
40
|
const useEventListener = payload.useEventListener &&
|
|
@@ -79,11 +81,12 @@ class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
79
81
|
const uiResp = await uiPromise.promise;
|
|
80
82
|
return uiResp.payload;
|
|
81
83
|
}
|
|
82
|
-
async _call({ address_n, show_display }) {
|
|
84
|
+
async _call({ address_n, show_display, chunkify }) {
|
|
83
85
|
const cmd = this.device.getCommands();
|
|
84
86
|
const response = await cmd.typedCall('StellarGetAddress', 'StellarAddress', {
|
|
85
87
|
address_n,
|
|
86
88
|
show_display,
|
|
89
|
+
chunkify,
|
|
87
90
|
});
|
|
88
91
|
return response.message;
|
|
89
92
|
}
|
|
@@ -16,7 +16,7 @@ export default class TezosGetAddress extends AbstractMethod<'tezosGetAddress', P
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display }: Params): Promise<PROTO.TezosAddress>;
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<PROTO.TezosAddress>;
|
|
20
20
|
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -27,12 +27,14 @@ class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
27
27
|
{ name: 'path', required: true },
|
|
28
28
|
{ name: 'address', type: 'string' },
|
|
29
29
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
30
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
30
31
|
]);
|
|
31
32
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
32
33
|
return {
|
|
33
34
|
address_n: path,
|
|
34
35
|
address: batch.address,
|
|
35
36
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
37
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
36
38
|
};
|
|
37
39
|
});
|
|
38
40
|
const useEventListener = payload.useEventListener &&
|
|
@@ -79,11 +81,12 @@ class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
79
81
|
const uiResp = await uiPromise.promise;
|
|
80
82
|
return uiResp.payload;
|
|
81
83
|
}
|
|
82
|
-
async _call({ address_n, show_display }) {
|
|
84
|
+
async _call({ address_n, show_display, chunkify }) {
|
|
83
85
|
const cmd = this.device.getCommands();
|
|
84
86
|
const response = await cmd.typedCall('TezosGetAddress', 'TezosAddress', {
|
|
85
87
|
address_n,
|
|
86
88
|
show_display,
|
|
89
|
+
chunkify,
|
|
87
90
|
});
|
|
88
91
|
return response.message;
|
|
89
92
|
}
|
|
@@ -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,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;
|
|
@@ -156,6 +156,17 @@ export declare class DataManager {
|
|
|
156
156
|
max?: undefined;
|
|
157
157
|
comment?: undefined;
|
|
158
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;
|
|
159
170
|
})[];
|
|
160
171
|
};
|
|
161
172
|
}
|
package/lib/data/config.d.ts
CHANGED
|
@@ -144,6 +144,17 @@ export declare const config: {
|
|
|
144
144
|
max?: undefined;
|
|
145
145
|
comment?: undefined;
|
|
146
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;
|
|
147
158
|
})[];
|
|
148
159
|
};
|
|
149
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
|
},
|
|
@@ -214,7 +214,14 @@ exports.config = {
|
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
methods: ['solanaGetPublicKey', 'solanaGetAddress', 'solanaSignTransaction'],
|
|
217
|
-
min: { T1B1: '0', T2T1: '2.
|
|
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
|
+
],
|
|
218
225
|
},
|
|
219
226
|
],
|
|
220
227
|
};
|
|
@@ -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;
|
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)();
|
|
@@ -303,7 +310,7 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
303
310
|
this._updateFeatures(message);
|
|
304
311
|
}
|
|
305
312
|
_updateFeatures(feat) {
|
|
306
|
-
var _a;
|
|
313
|
+
var _a, _b;
|
|
307
314
|
const capabilities = (0, deviceFeaturesUtils_1.parseCapabilities)(feat);
|
|
308
315
|
feat.capabilities = capabilities;
|
|
309
316
|
if (this.features && this.features.session_id && !feat.session_id) {
|
|
@@ -344,7 +351,10 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
344
351
|
? types_1.FirmwareType.BitcoinOnly
|
|
345
352
|
: types_1.FirmwareType.Regular;
|
|
346
353
|
}
|
|
347
|
-
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
|
+
};
|
|
348
358
|
this.name = deviceInfo.name;
|
|
349
359
|
if (feat === null || feat === void 0 ? void 0 : feat.unit_color) {
|
|
350
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;
|
|
@@ -157,7 +157,7 @@ class DeviceCommands {
|
|
|
157
157
|
}
|
|
158
158
|
return response;
|
|
159
159
|
}
|
|
160
|
-
async getAddress({ address_n, show_display, multisig, script_type }, coinInfo) {
|
|
160
|
+
async getAddress({ address_n, show_display, multisig, script_type, chunkify }, coinInfo) {
|
|
161
161
|
if (!script_type) {
|
|
162
162
|
script_type = (0, pathUtils_1.getScriptType)(address_n);
|
|
163
163
|
if (script_type === 'SPENDMULTISIG' && !multisig) {
|
|
@@ -177,6 +177,7 @@ class DeviceCommands {
|
|
|
177
177
|
show_display,
|
|
178
178
|
multisig,
|
|
179
179
|
script_type: script_type || 'SPENDADDRESS',
|
|
180
|
+
chunkify,
|
|
180
181
|
});
|
|
181
182
|
return {
|
|
182
183
|
path: address_n,
|
|
@@ -184,11 +185,12 @@ class DeviceCommands {
|
|
|
184
185
|
address: response.message.address,
|
|
185
186
|
};
|
|
186
187
|
}
|
|
187
|
-
async ethereumGetAddress({ address_n, show_display, encoded_network, }) {
|
|
188
|
+
async ethereumGetAddress({ address_n, show_display, encoded_network, chunkify, }) {
|
|
188
189
|
const response = await this.typedCall('EthereumGetAddress', 'EthereumAddress', {
|
|
189
190
|
address_n,
|
|
190
191
|
show_display,
|
|
191
192
|
encoded_network,
|
|
193
|
+
chunkify,
|
|
192
194
|
});
|
|
193
195
|
return {
|
|
194
196
|
path: address_n,
|
|
@@ -245,6 +247,7 @@ class DeviceCommands {
|
|
|
245
247
|
session: this.sessionId,
|
|
246
248
|
name: type,
|
|
247
249
|
data: msg,
|
|
250
|
+
protocol: this.device.protocol,
|
|
248
251
|
});
|
|
249
252
|
const res = await this.callPromise.promise;
|
|
250
253
|
this.callPromise = undefined;
|
|
@@ -264,7 +267,10 @@ class DeviceCommands {
|
|
|
264
267
|
assertType(response, resType);
|
|
265
268
|
}
|
|
266
269
|
catch (error) {
|
|
267
|
-
await this.transport.receive({
|
|
270
|
+
await this.transport.receive({
|
|
271
|
+
session: this.sessionId,
|
|
272
|
+
protocol: this.device.protocol,
|
|
273
|
+
});
|
|
268
274
|
throw error;
|
|
269
275
|
}
|
|
270
276
|
return response;
|
|
@@ -511,6 +517,7 @@ class DeviceCommands {
|
|
|
511
517
|
}
|
|
512
518
|
else {
|
|
513
519
|
await this.transport.send({
|
|
520
|
+
protocol: this.device.protocol,
|
|
514
521
|
session: this.sessionId,
|
|
515
522
|
name: 'Cancel',
|
|
516
523
|
data: {},
|
|
@@ -132,7 +132,7 @@ export interface UiRequestPermission {
|
|
|
132
132
|
export interface UiRequestConfirmation {
|
|
133
133
|
type: typeof UI_REQUEST.REQUEST_CONFIRMATION;
|
|
134
134
|
payload: {
|
|
135
|
-
view:
|
|
135
|
+
view: 'no-backup' | 'export-xpub' | 'export-address' | 'export-account-info' | 'device-management';
|
|
136
136
|
label?: string;
|
|
137
137
|
customConfirmButton?: {
|
|
138
138
|
className: string;
|
|
@@ -49,6 +49,7 @@ export interface TransactionOptions {
|
|
|
49
49
|
amount_unit?: PROTO.AmountUnit;
|
|
50
50
|
serialize?: boolean;
|
|
51
51
|
coinjoin_request?: PROTO.CoinJoinRequest;
|
|
52
|
+
chunkify?: boolean;
|
|
52
53
|
}
|
|
53
54
|
export interface SignTransaction {
|
|
54
55
|
inputs: ProtoWithDerivationPath<PROTO.TxInputType>[];
|
|
@@ -74,6 +75,7 @@ export interface SignTransaction {
|
|
|
74
75
|
unlockPath?: PROTO.UnlockPath;
|
|
75
76
|
serialize?: boolean;
|
|
76
77
|
coinjoinRequest?: PROTO.CoinJoinRequest;
|
|
78
|
+
chunkify?: boolean;
|
|
77
79
|
}
|
|
78
80
|
export type SignedTransaction = {
|
|
79
81
|
signatures: string[];
|
|
@@ -21,6 +21,7 @@ export interface CardanoGetAddress {
|
|
|
21
21
|
address?: string;
|
|
22
22
|
showOnTrezor?: boolean;
|
|
23
23
|
derivationType?: PROTO.CardanoDerivationType;
|
|
24
|
+
chunkify?: boolean;
|
|
24
25
|
}
|
|
25
26
|
export interface CardanoAddress {
|
|
26
27
|
addressParameters: CardanoAddressParameters;
|
|
@@ -177,6 +178,7 @@ export interface CardanoSignTransaction {
|
|
|
177
178
|
signingMode: PROTO.CardanoTxSigningMode;
|
|
178
179
|
derivationType?: PROTO.CardanoDerivationType;
|
|
179
180
|
includeNetworkId?: boolean;
|
|
181
|
+
chunkify?: boolean;
|
|
180
182
|
}
|
|
181
183
|
export interface CardanoSignedTxWitness {
|
|
182
184
|
type: PROTO.CardanoTxWitnessType;
|
|
@@ -35,6 +35,7 @@ export interface EthereumTransactionEIP1559 {
|
|
|
35
35
|
export interface EthereumSignTransaction {
|
|
36
36
|
path: DerivationPath;
|
|
37
37
|
transaction: EthereumTransaction | EthereumTransactionEIP1559;
|
|
38
|
+
chunkify?: boolean;
|
|
38
39
|
}
|
|
39
40
|
export interface EthereumSignedTx {
|
|
40
41
|
v: string;
|