@trezor/connect 9.1.6 → 9.1.8
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 -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/bitcoin/inputs.d.ts +2 -2
- package/lib/api/bitcoin/inputs.js +3 -3
- package/lib/api/bitcoin/refTx.d.ts +7 -7
- package/lib/api/bitcoin/refTx.js +69 -73
- package/lib/api/blockchainGetTransactions.d.ts +1 -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/changeWipeCode.d.ts +7 -0
- package/lib/api/changeWipeCode.js +22 -0
- package/lib/api/common/paramsValidator.js +5 -3
- package/lib/api/composeTransaction.js +4 -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/index.d.ts +1 -0
- package/lib/api/index.js +3 -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 +14 -4
- 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.d.ts +2 -1
- package/lib/backend/Blockchain.js +4 -0
- package/lib/core/AbstractMethod.js +4 -1
- 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/factory.js +1 -0
- package/lib/types/api/binance/index.d.ts +1 -0
- package/lib/types/api/bitcoin/index.d.ts +2 -0
- package/lib/types/api/blockchainGetTransactions.d.ts +2 -2
- package/lib/types/api/cardano/index.d.ts +2 -0
- package/lib/types/api/changeWipeCode.d.ts +4 -0
- package/lib/types/api/changeWipeCode.js +3 -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/index.d.ts +2 -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
|
@@ -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;
|
|
@@ -22,7 +22,8 @@ export declare class Blockchain {
|
|
|
22
22
|
constructor(options: BlockchainOptions);
|
|
23
23
|
onError(error: ERRORS.TrezorError): void;
|
|
24
24
|
init(): Promise<void>;
|
|
25
|
-
getTransactions(txs: string[]): Promise<import("@trezor/blockchain-link").
|
|
25
|
+
getTransactions(txs: string[]): Promise<import("@trezor/blockchain-link").Transaction[]>;
|
|
26
|
+
getTransactionHexes(txids: string[]): Promise<string[]>;
|
|
26
27
|
getCurrentFiatRates(params: {
|
|
27
28
|
currencies?: string[];
|
|
28
29
|
token?: string;
|
|
@@ -45,6 +45,7 @@ class Blockchain {
|
|
|
45
45
|
server,
|
|
46
46
|
debug: options.debug,
|
|
47
47
|
proxy: options.proxy,
|
|
48
|
+
...(blockchainLink.type === 'ripple' ? { throttleBlockEvent: 60 * 1000 } : {}),
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
onError(error) {
|
|
@@ -90,6 +91,9 @@ class Blockchain {
|
|
|
90
91
|
getTransactions(txs) {
|
|
91
92
|
return Promise.all(txs.map(id => this.link.getTransaction(id)));
|
|
92
93
|
}
|
|
94
|
+
getTransactionHexes(txids) {
|
|
95
|
+
return Promise.all(txids.map(id => this.link.getTransactionHex(id)));
|
|
96
|
+
}
|
|
93
97
|
getCurrentFiatRates(params) {
|
|
94
98
|
return this.link.getCurrentFiatRates(params);
|
|
95
99
|
}
|
|
@@ -130,12 +130,15 @@ class AbstractMethod {
|
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
const { device } = this;
|
|
133
|
-
if (!device.features)
|
|
133
|
+
if (!device.features || device.isBootloader())
|
|
134
134
|
return;
|
|
135
135
|
const range = this.firmwareRange[device.features.internal_model];
|
|
136
136
|
if (device.firmwareStatus === 'none') {
|
|
137
137
|
return events_1.UI.FIRMWARE_NOT_INSTALLED;
|
|
138
138
|
}
|
|
139
|
+
if (!range) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
139
142
|
if (range.min === '0') {
|
|
140
143
|
return events_1.UI.FIRMWARE_NOT_SUPPORTED;
|
|
141
144
|
}
|
|
@@ -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.8';
|
|
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;
|
package/lib/factory.js
CHANGED
|
@@ -121,6 +121,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
|
|
|
121
121
|
showDeviceTutorial: params => call({ ...params, method: 'showDeviceTutorial' }),
|
|
122
122
|
backupDevice: params => call({ ...params, method: 'backupDevice' }),
|
|
123
123
|
changePin: params => call({ ...params, method: 'changePin' }),
|
|
124
|
+
changeWipeCode: params => call({ ...params, method: 'changeWipeCode' }),
|
|
124
125
|
firmwareUpdate: params => call({ ...params, method: 'firmwareUpdate' }),
|
|
125
126
|
recoveryDevice: params => call({ ...params, method: 'recoveryDevice' }),
|
|
126
127
|
getCoinInfo: params => call({ ...params, method: 'getCoinInfo' }),
|
|
@@ -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[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Transaction } from '@trezor/blockchain-link';
|
|
2
2
|
import type { CommonParamsWithCoin, Response } from '../params';
|
|
3
3
|
export type BlockchainGetTransactions = CommonParamsWithCoin & {
|
|
4
4
|
txs: string[];
|
|
5
5
|
};
|
|
6
|
-
export declare function blockchainGetTransactions(params: BlockchainGetTransactions): Response<
|
|
6
|
+
export declare function blockchainGetTransactions(params: BlockchainGetTransactions): Response<Transaction[]>;
|
|
7
7
|
//# sourceMappingURL=blockchainGetTransactions.d.ts.map
|
|
@@ -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;
|
package/lib/types/api/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { cardanoGetPublicKey } from './cardanoGetPublicKey';
|
|
|
24
24
|
import { cardanoSignTransaction } from './cardanoSignTransaction';
|
|
25
25
|
import { cardanoComposeTransaction } from './cardanoComposeTransaction';
|
|
26
26
|
import { changePin } from './changePin';
|
|
27
|
+
import { changeWipeCode } from './changeWipeCode';
|
|
27
28
|
import { cipherKeyValue } from './cipherKeyValue';
|
|
28
29
|
import { composeTransaction } from './composeTransaction';
|
|
29
30
|
import { disableWebUSB } from './disableWebUSB';
|
|
@@ -112,6 +113,7 @@ export interface TrezorConnect {
|
|
|
112
113
|
cardanoSignTransaction: typeof cardanoSignTransaction;
|
|
113
114
|
cardanoComposeTransaction: typeof cardanoComposeTransaction;
|
|
114
115
|
changePin: typeof changePin;
|
|
116
|
+
changeWipeCode: typeof changeWipeCode;
|
|
115
117
|
cipherKeyValue: typeof cipherKeyValue;
|
|
116
118
|
composeTransaction: typeof composeTransaction;
|
|
117
119
|
disableWebUSB: typeof disableWebUSB;
|
|
@@ -2,9 +2,19 @@ import type { PublicKey } from '../../params';
|
|
|
2
2
|
export interface SolanaPublicKey extends PublicKey {
|
|
3
3
|
publicKey: string;
|
|
4
4
|
}
|
|
5
|
+
export interface SolanaTxTokenAccountInfo {
|
|
6
|
+
baseAddress: string;
|
|
7
|
+
tokenProgram: string;
|
|
8
|
+
tokenMint: string;
|
|
9
|
+
tokenAccount: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SolanaTxAdditionalInfo {
|
|
12
|
+
tokenAccountsInfos?: SolanaTxTokenAccountInfo[];
|
|
13
|
+
}
|
|
5
14
|
export interface SolanaSignTransaction {
|
|
6
15
|
path: string | number[];
|
|
7
16
|
serializedTx: string;
|
|
17
|
+
additionalInfo?: SolanaTxAdditionalInfo;
|
|
8
18
|
}
|
|
9
19
|
export interface SolanaSignedTransaction {
|
|
10
20
|
signature: string;
|
package/lib/types/coinInfo.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { FeeLevel } from './fees';
|
|
|
3
3
|
export type { Network } from '@trezor/utxo-lib';
|
|
4
4
|
export interface CoinSupport {
|
|
5
5
|
connect: boolean;
|
|
6
|
-
T1B1: string;
|
|
7
|
-
T2T1: string;
|
|
8
|
-
T2B1: string;
|
|
6
|
+
T1B1: string | false;
|
|
7
|
+
T2T1: string | false;
|
|
8
|
+
T2B1: string | false;
|
|
9
9
|
}
|
|
10
10
|
export interface BlockchainLink {
|
|
11
11
|
type: string;
|
package/lib/types/device.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { PROTO } from '../constants';
|
|
|
2
2
|
import type { ReleaseInfo } from './firmware';
|
|
3
3
|
export type DeviceStatus = 'available' | 'occupied' | 'used';
|
|
4
4
|
export type DeviceMode = 'normal' | 'bootloader' | 'initialize' | 'seedless';
|
|
5
|
-
export type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none';
|
|
5
|
+
export type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'custom' | 'none';
|
|
6
6
|
export type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated';
|
|
7
7
|
export declare enum FirmwareType {
|
|
8
8
|
BitcoinOnly = "bitcoin-only",
|
package/lib/types/params.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface CommonParams {
|
|
|
11
11
|
override?: boolean;
|
|
12
12
|
skipFinalReload?: boolean;
|
|
13
13
|
useCardanoDerivation?: boolean;
|
|
14
|
+
chunkify?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export type Params<T> = CommonParams & T & {
|
|
16
17
|
bundle?: undefined;
|
|
@@ -49,6 +50,7 @@ export interface GetAddress {
|
|
|
49
50
|
path: DerivationPath;
|
|
50
51
|
address?: string;
|
|
51
52
|
showOnTrezor?: boolean;
|
|
53
|
+
chunkify?: boolean;
|
|
52
54
|
}
|
|
53
55
|
export interface Address {
|
|
54
56
|
address: string;
|
|
@@ -59,6 +61,7 @@ export interface GetPublicKey {
|
|
|
59
61
|
path: DerivationPath;
|
|
60
62
|
showOnTrezor?: boolean;
|
|
61
63
|
suppressBackupWarning?: boolean;
|
|
64
|
+
chunkify?: boolean;
|
|
62
65
|
}
|
|
63
66
|
export interface PublicKey {
|
|
64
67
|
publicKey: string;
|
package/lib/utils/debug.d.ts
CHANGED
|
@@ -14,7 +14,11 @@ export declare class Log {
|
|
|
14
14
|
messages: LogMessage[];
|
|
15
15
|
logWriter: LogWriter | undefined;
|
|
16
16
|
constructor(prefix: string, enabled: boolean, logWriter?: LogWriter);
|
|
17
|
-
addMessage(level
|
|
17
|
+
addMessage({ level, prefix, timestamp }: {
|
|
18
|
+
level: string;
|
|
19
|
+
prefix: string;
|
|
20
|
+
timestamp?: number;
|
|
21
|
+
}, ...args: any[]): void;
|
|
18
22
|
setWriter(logWriter: any): void;
|
|
19
23
|
log(...args: any[]): void;
|
|
20
24
|
error(...args: any[]): void;
|
package/lib/utils/debug.js
CHANGED
|
@@ -8,6 +8,7 @@ const yellow = '#fbd948';
|
|
|
8
8
|
const colors = {
|
|
9
9
|
'@trezor/connect': `color: ${blue}; background: #000;`,
|
|
10
10
|
'@trezor/connect-web': `color: ${blue}; background: #000;`,
|
|
11
|
+
'@trezor/connect-webextension': `color: ${blue}; background: #000;`,
|
|
11
12
|
IFrame: `color: ${orange}; background: #000;`,
|
|
12
13
|
Core: `color: ${orange}; background: #000;`,
|
|
13
14
|
DeviceList: `color: ${green}; background: #000;`,
|
|
@@ -28,13 +29,13 @@ class Log {
|
|
|
28
29
|
this.logWriter = logWriter;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
addMessage(level, prefix, ...args) {
|
|
32
|
+
addMessage({ level, prefix, timestamp }, ...args) {
|
|
32
33
|
const message = {
|
|
33
34
|
level,
|
|
34
35
|
prefix,
|
|
35
36
|
css: this.css,
|
|
36
37
|
message: args,
|
|
37
|
-
timestamp: Date.now(),
|
|
38
|
+
timestamp: timestamp || Date.now(),
|
|
38
39
|
};
|
|
39
40
|
this.messages.push(message);
|
|
40
41
|
if (this.logWriter) {
|
|
@@ -53,25 +54,25 @@ class Log {
|
|
|
53
54
|
this.logWriter = logWriter;
|
|
54
55
|
}
|
|
55
56
|
log(...args) {
|
|
56
|
-
this.addMessage('log', this.prefix, ...args);
|
|
57
|
+
this.addMessage({ level: 'log', prefix: this.prefix }, ...args);
|
|
57
58
|
if (this.enabled) {
|
|
58
59
|
console.log(`%c${this.prefix}`, this.css, ...args);
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
error(...args) {
|
|
62
|
-
this.addMessage('error', this.prefix, ...args);
|
|
63
|
+
this.addMessage({ level: 'error', prefix: this.prefix }, ...args);
|
|
63
64
|
if (this.enabled) {
|
|
64
65
|
console.error(`%c${this.prefix}`, this.css, ...args);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
warn(...args) {
|
|
68
|
-
this.addMessage('warn', this.prefix, ...args);
|
|
69
|
+
this.addMessage({ level: 'warn', prefix: this.prefix }, ...args);
|
|
69
70
|
if (this.enabled) {
|
|
70
71
|
console.warn(`%c${this.prefix}`, this.css, ...args);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
debug(...args) {
|
|
74
|
-
this.addMessage('debug', this.prefix, ...args);
|
|
75
|
+
this.addMessage({ level: 'debug', prefix: this.prefix }, ...args);
|
|
75
76
|
if (this.enabled) {
|
|
76
77
|
if (this.css) {
|
|
77
78
|
console.log(`%c${this.prefix}`, this.css, ...args);
|