@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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
# 9.1.7
|
|
2
|
+
|
|
3
|
+
- fix(connect): correct UiRequestConfirmation type in solanaGetPublicKey (a93ea1890)
|
|
4
|
+
- chore(connect): stricter UiRequestConfirmation types (f35bd28bf)
|
|
5
|
+
- feat(connect-common): add more backend urls for solana (29f042470)
|
|
6
|
+
- chore: Throttler throttling instead of debouncing in `@trezor/blockchain-link` (#10288) (f7ff0cf9f)
|
|
7
|
+
- feat(transport): accept encoding protocols as parameter of send, receive and call methods (b64af958e)
|
|
8
|
+
- fix(connect-explorer): fs, path, fallbacks in webpack (4f5a15e32)
|
|
9
|
+
- chore(connect-common): update fw binaries to 2.6.4 (398509788)
|
|
10
|
+
- docs(connect): update index page (8cb5262f6)
|
|
11
|
+
- feat(connect-explorer): update SVG in Header component (e8d9beace)
|
|
12
|
+
- feat(connect-explorer): update favicon image (a8d660dd2)
|
|
13
|
+
- feat(connect-explorer): add Solana (799bf63f5)
|
|
14
|
+
- chore(connect): update downgraded @ethereumjs libs (9ac430c42)
|
|
15
|
+
- chore(connect): add option for chunkify solana `getAddress` method (98d234f31)
|
|
16
|
+
- fix(connect-explorer-webextension): add commitHash to webpack (6b6b77d9d)
|
|
17
|
+
- feat(suite): add Solana support (f2a89b34f)
|
|
18
|
+
- chore: add Holesky (175707861,8776bb79c)
|
|
19
|
+
- feat(connect-explorer): version docs (6ea9ef1f2)
|
|
20
|
+
- fix(connect-popup): when connect-src not same as host popup display unknown origin (1bc6f2da1)
|
|
21
|
+
- feat(connect-explorer, connect): add `chunkify` paramater to getAddress and signTx methods (7e01923f0,2926b2bdb)
|
|
22
|
+
- fix(connect-popup): handle METHOD_INFO (e6d11072b)
|
|
23
|
+
- fix(connect): support unknown (custom) internal_models (0915d8893)
|
|
24
|
+
- fix(cardano): fee estimate for set-max output (c50a8f2c7)
|
|
25
|
+
- chore(connect): use `tslib` as dependency in all public libs (606ecc63b)
|
|
26
|
+
- chore: update `jest` and related dependency (b8a321c83)
|
|
27
|
+
- chore(connect-examples): cleanup unused lines in script (b509d24d5)
|
|
28
|
+
- chore(connect-webextension): postMessage useQueue param (4e626e758)
|
|
29
|
+
- chore(repo): update tsx (53de3e3a8)
|
|
30
|
+
- chore(connect): remove Solana beta console logs (3ea8343ee)
|
|
31
|
+
- chore(docs): add link to internal description of device authenticity config update (ee9ad470a)
|
|
32
|
+
- chore(connect): add new CA pubkeys and update timestamp (b64c3f411)
|
|
33
|
+
|
|
1
34
|
# 9.1.6
|
|
2
35
|
|
|
3
36
|
- chore(connect): remove web3-utils (2f683f6)
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @trezor/connect
|
|
2
2
|
|
|
3
|
-
API version 9.1.
|
|
3
|
+
API version 9.1.7
|
|
4
4
|
|
|
5
5
|
[](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
|
|
6
6
|
[](https://www.npmjs.org/package/@trezor/connect)
|
|
@@ -16,7 +16,7 @@ export default class BinanceGetAddress extends AbstractMethod<'binanceGetAddress
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display }: Params): Promise<PROTO.BinanceAddress>;
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<PROTO.BinanceAddress>;
|
|
20
20
|
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -27,12 +27,14 @@ class BinanceGetAddress 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 BinanceGetAddress 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('BinanceGetAddress', 'BinanceAddress', {
|
|
85
87
|
address_n,
|
|
86
88
|
show_display,
|
|
89
|
+
chunkify,
|
|
87
90
|
});
|
|
88
91
|
return response.message;
|
|
89
92
|
}
|
|
@@ -3,6 +3,7 @@ import type { BinancePreparedTransaction } from '../../../types/api/binance';
|
|
|
3
3
|
type Params = {
|
|
4
4
|
path: number[];
|
|
5
5
|
transaction: BinancePreparedTransaction;
|
|
6
|
+
chunkify?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class BinanceSignTransaction extends AbstractMethod<'binanceSignTransaction', Params> {
|
|
8
9
|
init(): void;
|
|
@@ -14,19 +14,21 @@ class BinanceSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
14
14
|
(0, paramsValidator_1.validateParams)(payload, [
|
|
15
15
|
{ name: 'path', type: 'string', required: true },
|
|
16
16
|
{ name: 'transaction', required: true },
|
|
17
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
17
18
|
]);
|
|
18
19
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
19
20
|
const transaction = helper.validate(payload.transaction);
|
|
20
21
|
this.params = {
|
|
21
22
|
path,
|
|
22
23
|
transaction,
|
|
24
|
+
chunkify: typeof payload.chunkify === 'boolean' ? payload.chunkify : false,
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
get info() {
|
|
26
28
|
return 'Sign Binance transaction';
|
|
27
29
|
}
|
|
28
30
|
run() {
|
|
29
|
-
return helper.signTx(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, this.params.transaction);
|
|
31
|
+
return helper.signTx(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, this.params.transaction, this.params.chunkify);
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
exports.default = BinanceSignTransaction;
|
|
@@ -2,5 +2,5 @@ import { PROTO } from '../../constants';
|
|
|
2
2
|
import type { BinanceSDKTransaction, BinancePreparedTransaction } from '../../types/api/binance';
|
|
3
3
|
import type { TypedCall } from '../../device/DeviceCommands';
|
|
4
4
|
export declare const validate: (tx: BinanceSDKTransaction) => BinancePreparedTransaction;
|
|
5
|
-
export declare const signTx: (typedCall: TypedCall, address_n: number[], tx: BinancePreparedTransaction) => Promise<PROTO.BinanceSignedTx>;
|
|
5
|
+
export declare const signTx: (typedCall: TypedCall, address_n: number[], tx: BinancePreparedTransaction, chunkify?: boolean) => Promise<PROTO.BinanceSignedTx>;
|
|
6
6
|
//# sourceMappingURL=binanceSignTx.d.ts.map
|
|
@@ -73,7 +73,7 @@ const validate = (tx) => {
|
|
|
73
73
|
return preparedTx;
|
|
74
74
|
};
|
|
75
75
|
exports.validate = validate;
|
|
76
|
-
const signTx = async (typedCall, address_n, tx) => {
|
|
76
|
+
const signTx = async (typedCall, address_n, tx, chunkify) => {
|
|
77
77
|
const { account_number, chain_id, memo, sequence, source, messages } = tx;
|
|
78
78
|
const msg_count = messages.length;
|
|
79
79
|
await typedCall('BinanceSignTx', 'BinanceTxRequest', {
|
|
@@ -84,6 +84,7 @@ const signTx = async (typedCall, address_n, tx) => {
|
|
|
84
84
|
memo,
|
|
85
85
|
sequence,
|
|
86
86
|
source,
|
|
87
|
+
chunkify,
|
|
87
88
|
});
|
|
88
89
|
return processTxRequest(typedCall, messages, 0);
|
|
89
90
|
};
|
|
@@ -16,7 +16,7 @@ export default class CardanoGetAddress extends AbstractMethod<'cardanoGetAddress
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_parameters, protocol_magic, network_id, derivation_type, show_display, }: Params): Promise<PROTO.CardanoAddress>;
|
|
19
|
+
_call({ address_parameters, protocol_magic, network_id, derivation_type, show_display, chunkify, }: Params): Promise<PROTO.CardanoAddress>;
|
|
20
20
|
_ensureFirmwareSupportsBatch(batch: Params): void;
|
|
21
21
|
run(): Promise<import("../../..").CardanoAddress | import("../../..").CardanoAddress[]>;
|
|
22
22
|
}
|
|
@@ -31,6 +31,7 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
31
31
|
{ name: 'derivationType', type: 'number' },
|
|
32
32
|
{ name: 'address', type: 'string' },
|
|
33
33
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
34
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
34
35
|
]);
|
|
35
36
|
(0, cardanoAddressParameters_1.validateAddressParameters)(batch.addressParameters);
|
|
36
37
|
return {
|
|
@@ -42,6 +43,7 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
42
43
|
? batch.derivationType
|
|
43
44
|
: constants_1.PROTO.CardanoDerivationType.ICARUS_TREZOR,
|
|
44
45
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
46
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
45
47
|
};
|
|
46
48
|
});
|
|
47
49
|
const useEventListener = payload.useEventListener &&
|
|
@@ -88,7 +90,7 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
88
90
|
const uiResp = await uiPromise.promise;
|
|
89
91
|
return uiResp.payload;
|
|
90
92
|
}
|
|
91
|
-
async _call({ address_parameters, protocol_magic, network_id, derivation_type, show_display, }) {
|
|
93
|
+
async _call({ address_parameters, protocol_magic, network_id, derivation_type, show_display, chunkify, }) {
|
|
92
94
|
const cmd = this.device.getCommands();
|
|
93
95
|
const response = await cmd.typedCall('CardanoGetAddress', 'CardanoAddress', {
|
|
94
96
|
address_parameters,
|
|
@@ -96,6 +98,7 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
96
98
|
network_id,
|
|
97
99
|
derivation_type,
|
|
98
100
|
show_display,
|
|
101
|
+
chunkify,
|
|
99
102
|
});
|
|
100
103
|
return response.message;
|
|
101
104
|
}
|
|
@@ -46,6 +46,7 @@ export type CardanoSignTransactionParams = {
|
|
|
46
46
|
hash: string;
|
|
47
47
|
};
|
|
48
48
|
testnet?: boolean;
|
|
49
|
+
chunkify?: boolean;
|
|
49
50
|
};
|
|
50
51
|
export default class CardanoSignTransaction extends AbstractMethod<'cardanoSignTransaction', CardanoSignTransactionParams> {
|
|
51
52
|
init(): void;
|
|
@@ -68,6 +68,7 @@ class CardanoSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
68
68
|
{ name: 'includeNetworkId', type: 'boolean' },
|
|
69
69
|
{ name: 'unsignedTx', type: 'object' },
|
|
70
70
|
{ name: 'testnet', type: 'boolean' },
|
|
71
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
71
72
|
]);
|
|
72
73
|
const inputsWithPath = payload.inputs.map(cardanoInputs_1.transformInput);
|
|
73
74
|
const outputsWithData = payload.outputs.map(cardanoOutputs_1.transformOutput);
|
|
@@ -153,6 +154,7 @@ class CardanoSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
153
154
|
includeNetworkId: payload.includeNetworkId,
|
|
154
155
|
unsignedTx: 'unsignedTx' in payload ? payload.unsignedTx : undefined,
|
|
155
156
|
testnet: 'testnet' in payload ? payload.testnet : undefined,
|
|
157
|
+
chunkify: typeof payload.chunkify === 'boolean' ? payload.chunkify : false,
|
|
156
158
|
};
|
|
157
159
|
}
|
|
158
160
|
get info() {
|
|
@@ -254,6 +256,7 @@ class CardanoSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
254
256
|
reference_inputs_count: this.params.referenceInputs.length,
|
|
255
257
|
derivation_type: this.params.derivationType,
|
|
256
258
|
include_network_id: this.params.includeNetworkId,
|
|
259
|
+
chunkify: this.params.chunkify,
|
|
257
260
|
};
|
|
258
261
|
await typedCall('CardanoSignTxInit', 'CardanoTxItemAck', signTxInitMessage);
|
|
259
262
|
for (const { input } of this.params.inputsWithPath) {
|
|
@@ -72,12 +72,14 @@ const getFirmwareRange = (method, coinInfo, currentRange) => {
|
|
|
72
72
|
const models = Object.keys(range);
|
|
73
73
|
if (coinInfo) {
|
|
74
74
|
models.forEach(model => {
|
|
75
|
-
|
|
75
|
+
const supportVersion = coinInfo.support ? coinInfo.support[model] : false;
|
|
76
|
+
if (supportVersion === false) {
|
|
76
77
|
range[model].min = '0';
|
|
77
78
|
}
|
|
78
79
|
else if (range[model].min !== '0' &&
|
|
79
|
-
|
|
80
|
-
range[model].min
|
|
80
|
+
typeof supportVersion === 'string' &&
|
|
81
|
+
utils_1.versionUtils.isNewer(supportVersion, range[model].min)) {
|
|
82
|
+
range[model].min = supportVersion;
|
|
81
83
|
}
|
|
82
84
|
});
|
|
83
85
|
}
|
|
@@ -18,11 +18,13 @@ class EosGetPublicKey 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 : false,
|
|
27
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
26
28
|
};
|
|
27
29
|
});
|
|
28
30
|
}
|
|
@@ -14,6 +14,7 @@ class EosSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
14
14
|
(0, paramsValidator_1.validateParams)(payload, [
|
|
15
15
|
{ name: 'path', required: true },
|
|
16
16
|
{ name: 'transaction', required: true },
|
|
17
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
17
18
|
]);
|
|
18
19
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
19
20
|
const { chain_id, header, ack } = helper.validate(payload.transaction);
|
|
@@ -22,13 +23,14 @@ class EosSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
22
23
|
chain_id,
|
|
23
24
|
header,
|
|
24
25
|
ack,
|
|
26
|
+
chunkify: typeof payload.chunkify === 'boolean' ? payload.chunkify : false,
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
get info() {
|
|
28
30
|
return 'Sign EOS transaction';
|
|
29
31
|
}
|
|
30
32
|
async run() {
|
|
31
|
-
const response = await helper.signTx(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, this.params.chain_id, this.params.header, this.params.ack);
|
|
33
|
+
const response = await helper.signTx(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, this.params.chain_id, this.params.header, this.params.ack, this.params.chunkify);
|
|
32
34
|
return {
|
|
33
35
|
signature: response.signature,
|
|
34
36
|
};
|
|
@@ -13,5 +13,5 @@ export declare const validate: (tx: EosSDKTransaction) => {
|
|
|
13
13
|
};
|
|
14
14
|
ack: PROTO.EosTxActionAck[];
|
|
15
15
|
};
|
|
16
|
-
export declare const signTx: (typedCall: TypedCall, address_n: number[], chain_id: string, header: PROTO.EosTxHeader, actions: PROTO.EosTxActionAck[]) => Promise<PROTO.EosSignedTx>;
|
|
16
|
+
export declare const signTx: (typedCall: TypedCall, address_n: number[], chain_id: string, header: PROTO.EosTxHeader, actions: PROTO.EosTxActionAck[], chunkify: boolean) => Promise<PROTO.EosSignedTx>;
|
|
17
17
|
//# sourceMappingURL=eosSignTx.d.ts.map
|
package/lib/api/eos/eosSignTx.js
CHANGED
|
@@ -334,12 +334,13 @@ const processTxRequest = async (typedCall, message, actions, index) => {
|
|
|
334
334
|
}
|
|
335
335
|
return processTxRequest(typedCall, ack.message, actions, index);
|
|
336
336
|
};
|
|
337
|
-
const signTx = async (typedCall, address_n, chain_id, header, actions) => {
|
|
337
|
+
const signTx = async (typedCall, address_n, chain_id, header, actions, chunkify) => {
|
|
338
338
|
const response = await typedCall('EosSignTx', 'EosTxActionRequest', {
|
|
339
339
|
address_n,
|
|
340
340
|
chain_id,
|
|
341
341
|
header,
|
|
342
342
|
num_actions: actions.length,
|
|
343
|
+
chunkify,
|
|
343
344
|
});
|
|
344
345
|
return processTxRequest(typedCall, response.message, actions, 0);
|
|
345
346
|
};
|
|
@@ -20,7 +20,7 @@ export default class EthereumGetAddress extends AbstractMethod<'ethereumGetAddre
|
|
|
20
20
|
} | undefined;
|
|
21
21
|
confirmation(): Promise<boolean>;
|
|
22
22
|
noBackupConfirmation(): Promise<boolean>;
|
|
23
|
-
_call({ address_n, show_display, encoded_network }: Params): Promise<{
|
|
23
|
+
_call({ address_n, show_display, encoded_network, chunkify }: Params): Promise<{
|
|
24
24
|
path: number[];
|
|
25
25
|
serializedPath: string;
|
|
26
26
|
address: string;
|
|
@@ -29,6 +29,7 @@ class EthereumGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
29
29
|
{ name: 'path', required: true },
|
|
30
30
|
{ name: 'address', type: 'string' },
|
|
31
31
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
32
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
32
33
|
]);
|
|
33
34
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
34
35
|
const network = (0, coinInfo_1.getEthereumNetwork)(path);
|
|
@@ -38,6 +39,7 @@ class EthereumGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
38
39
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
39
40
|
address: batch.address,
|
|
40
41
|
network,
|
|
42
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
41
43
|
};
|
|
42
44
|
});
|
|
43
45
|
const useEventListener = payload.useEventListener &&
|
|
@@ -106,12 +108,13 @@ class EthereumGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
106
108
|
const uiResp = await uiPromise.promise;
|
|
107
109
|
return uiResp.payload;
|
|
108
110
|
}
|
|
109
|
-
_call({ address_n, show_display, encoded_network }) {
|
|
111
|
+
_call({ address_n, show_display, encoded_network, chunkify }) {
|
|
110
112
|
const cmd = this.device.getCommands();
|
|
111
113
|
return cmd.ethereumGetAddress({
|
|
112
114
|
address_n,
|
|
113
115
|
show_display,
|
|
114
116
|
encoded_network,
|
|
117
|
+
chunkify,
|
|
115
118
|
});
|
|
116
119
|
}
|
|
117
120
|
async run() {
|
|
@@ -23,9 +23,11 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
23
23
|
(0, paramsValidator_1.validateParams)(payload, [
|
|
24
24
|
{ name: 'path', required: true },
|
|
25
25
|
{ name: 'transaction', required: true },
|
|
26
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
26
27
|
]);
|
|
27
28
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
28
29
|
const network = (0, coinInfo_1.getEthereumNetwork)(path);
|
|
30
|
+
const chunkify = typeof payload.chunkify === 'boolean' ? payload.chunkify : false;
|
|
29
31
|
const tx = payload.transaction;
|
|
30
32
|
const isEIP1559 = typeof tx.maxFeePerGas === 'string' && typeof tx.maxPriorityFeePerGas === 'string';
|
|
31
33
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(isEIP1559 ? 'eip1559' : this.name, network, this.firmwareRange);
|
|
@@ -40,7 +42,7 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
40
42
|
{ name: 'data', type: 'string' },
|
|
41
43
|
{ name: 'chainId', type: 'number', required: true },
|
|
42
44
|
]);
|
|
43
|
-
this.params = { path, network, type: 'eip1559', tx: strip(tx) };
|
|
45
|
+
this.params = { path, network, type: 'eip1559', tx: strip(tx), chunkify };
|
|
44
46
|
}
|
|
45
47
|
else {
|
|
46
48
|
(0, paramsValidator_1.validateParams)(tx, [
|
|
@@ -53,7 +55,7 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
53
55
|
{ name: 'chainId', type: 'number' },
|
|
54
56
|
{ name: 'txType', type: 'number' },
|
|
55
57
|
]);
|
|
56
|
-
this.params = { path, network, type: 'legacy', tx: strip(tx) };
|
|
58
|
+
this.params = { path, network, type: 'legacy', tx: strip(tx), chunkify };
|
|
57
59
|
}
|
|
58
60
|
if (typeof tx.chainId !== 'number') {
|
|
59
61
|
console.warn('TrezorConnect.ethereumSignTransaction: Missing chainId parameter!');
|
|
@@ -79,10 +81,10 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
79
81
|
return (0, ethereumUtils_1.getNetworkLabel)('Sign #NETWORK transaction', this.params.network);
|
|
80
82
|
}
|
|
81
83
|
async run() {
|
|
82
|
-
const { type, tx, definitions } = this.params;
|
|
84
|
+
const { type, tx, definitions, chunkify } = this.params;
|
|
83
85
|
const signature = type === 'eip1559'
|
|
84
|
-
? await helper.ethereumSignTxEIP1559(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, tx.to, tx.value, tx.gasLimit, tx.maxFeePerGas, tx.maxPriorityFeePerGas, tx.nonce, tx.chainId, tx.data, tx.accessList, definitions)
|
|
85
|
-
: await helper.ethereumSignTx(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, tx.to, tx.value, tx.gasLimit, tx.gasPrice, tx.nonce, tx.chainId, tx.data, tx.txType, definitions);
|
|
86
|
+
? await helper.ethereumSignTxEIP1559(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, tx.to, tx.value, tx.gasLimit, tx.maxFeePerGas, tx.maxPriorityFeePerGas, tx.nonce, tx.chainId, chunkify, tx.data, tx.accessList, definitions)
|
|
87
|
+
: await helper.ethereumSignTx(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, tx.to, tx.value, tx.gasLimit, tx.gasPrice, tx.nonce, tx.chainId, chunkify, tx.data, tx.txType, definitions);
|
|
86
88
|
const serializedTx = helper.serializeEthereumTx({
|
|
87
89
|
...tx,
|
|
88
90
|
...signature,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FeeMarketEIP1559TxData, LegacyTxData } from '@ethereumjs/tx';
|
|
2
2
|
import { EthereumDefinitions } from '@trezor/protobuf/lib/messages';
|
|
3
3
|
import type { TypedCall } from '../../device/DeviceCommands';
|
|
4
4
|
import type { EthereumAccessList } from '../../types/api/ethereum';
|
|
5
|
-
export declare const serializeEthereumTx: (txData:
|
|
6
|
-
export declare const ethereumSignTx: (typedCall: TypedCall, address_n: number[], to: string, value: string, gas_limit: string, gas_price: string, nonce: string, chain_id: number, data?: string, tx_type?: number, definitions?: EthereumDefinitions) => Promise<{
|
|
5
|
+
export declare const serializeEthereumTx: (txData: LegacyTxData | FeeMarketEIP1559TxData, chainId: number) => string;
|
|
6
|
+
export declare const ethereumSignTx: (typedCall: TypedCall, address_n: number[], to: string, value: string, gas_limit: string, gas_price: string, nonce: string, chain_id: number, chunkify: boolean, data?: string, tx_type?: number, definitions?: EthereumDefinitions) => Promise<{
|
|
7
7
|
v: string;
|
|
8
8
|
r: string;
|
|
9
9
|
s: string;
|
|
10
10
|
}>;
|
|
11
|
-
export declare const ethereumSignTxEIP1559: (typedCall: TypedCall, address_n: number[], to: string, value: string, gas_limit: string, max_gas_fee: string, max_priority_fee: string, nonce: string, chain_id: number, data?: string, access_list?: EthereumAccessList[], definitions?: EthereumDefinitions) => Promise<{
|
|
11
|
+
export declare const ethereumSignTxEIP1559: (typedCall: TypedCall, address_n: number[], to: string, value: string, gas_limit: string, max_gas_fee: string, max_priority_fee: string, nonce: string, chain_id: number, chunkify: boolean, data?: string, access_list?: EthereumAccessList[], definitions?: EthereumDefinitions) => Promise<{
|
|
12
12
|
v: string;
|
|
13
13
|
r: string;
|
|
14
14
|
s: string;
|
|
@@ -51,7 +51,7 @@ const stripLeadingZeroes = (str) => {
|
|
|
51
51
|
}
|
|
52
52
|
return str;
|
|
53
53
|
};
|
|
54
|
-
const ethereumSignTx = async (typedCall, address_n, to, value, gas_limit, gas_price, nonce, chain_id, data, tx_type, definitions) => {
|
|
54
|
+
const ethereumSignTx = async (typedCall, address_n, to, value, gas_limit, gas_price, nonce, chain_id, chunkify, data, tx_type, definitions) => {
|
|
55
55
|
const length = data == null ? 0 : data.length / 2;
|
|
56
56
|
const [first, rest] = splitString(data, 1024 * 2);
|
|
57
57
|
let message = {
|
|
@@ -63,6 +63,7 @@ const ethereumSignTx = async (typedCall, address_n, to, value, gas_limit, gas_pr
|
|
|
63
63
|
to,
|
|
64
64
|
value: stripLeadingZeroes(value),
|
|
65
65
|
definitions,
|
|
66
|
+
chunkify,
|
|
66
67
|
};
|
|
67
68
|
if (length !== 0) {
|
|
68
69
|
message = {
|
|
@@ -81,7 +82,7 @@ const ethereumSignTx = async (typedCall, address_n, to, value, gas_limit, gas_pr
|
|
|
81
82
|
return processTxRequest(typedCall, response.message, rest, chain_id);
|
|
82
83
|
};
|
|
83
84
|
exports.ethereumSignTx = ethereumSignTx;
|
|
84
|
-
const ethereumSignTxEIP1559 = async (typedCall, address_n, to, value, gas_limit, max_gas_fee, max_priority_fee, nonce, chain_id, data, access_list, definitions) => {
|
|
85
|
+
const ethereumSignTxEIP1559 = async (typedCall, address_n, to, value, gas_limit, max_gas_fee, max_priority_fee, nonce, chain_id, chunkify, data, access_list, definitions) => {
|
|
85
86
|
const length = data == null ? 0 : data.length / 2;
|
|
86
87
|
const [first, rest] = splitString(data, 1024 * 2);
|
|
87
88
|
const message = {
|
|
@@ -100,6 +101,7 @@ const ethereumSignTxEIP1559 = async (typedCall, address_n, to, value, gas_limit,
|
|
|
100
101
|
storage_keys: a.storageKeys,
|
|
101
102
|
})),
|
|
102
103
|
definitions,
|
|
104
|
+
chunkify,
|
|
103
105
|
};
|
|
104
106
|
const response = await typedCall('EthereumSignTxEIP1559', 'EthereumTxRequest', message);
|
|
105
107
|
return processTxRequest(typedCall, response.message, rest);
|
package/lib/api/getAddress.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export default class GetAddress extends AbstractMethod<'getAddress', Params[]> {
|
|
|
19
19
|
} | undefined;
|
|
20
20
|
confirmation(): Promise<boolean>;
|
|
21
21
|
noBackupConfirmation(): Promise<boolean>;
|
|
22
|
-
_call({ address_n, show_display, multisig, script_type, coinInfo, unlockPath }: Params): Promise<{
|
|
22
|
+
_call({ address_n, show_display, multisig, script_type, coinInfo, unlockPath, chunkify, }: Params): Promise<{
|
|
23
23
|
path: number[];
|
|
24
24
|
serializedPath: string;
|
|
25
25
|
address: string;
|
package/lib/api/getAddress.js
CHANGED
|
@@ -30,6 +30,7 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
30
30
|
{ name: 'multisig', type: 'object' },
|
|
31
31
|
{ name: 'scriptType', type: 'string' },
|
|
32
32
|
{ name: 'unlockPath', type: 'object' },
|
|
33
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
33
34
|
]);
|
|
34
35
|
if (batch.unlockPath) {
|
|
35
36
|
(0, paramsValidator_1.validateParams)(batch.unlockPath, [
|
|
@@ -63,6 +64,7 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
63
64
|
script_type: batch.scriptType,
|
|
64
65
|
coinInfo,
|
|
65
66
|
unlockPath: batch.unlockPath,
|
|
67
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
66
68
|
};
|
|
67
69
|
});
|
|
68
70
|
const useEventListener = payload.useEventListener &&
|
|
@@ -114,7 +116,7 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
114
116
|
const uiResp = await uiPromise.promise;
|
|
115
117
|
return uiResp.payload;
|
|
116
118
|
}
|
|
117
|
-
async _call({ address_n, show_display, multisig, script_type, coinInfo, unlockPath }) {
|
|
119
|
+
async _call({ address_n, show_display, multisig, script_type, coinInfo, unlockPath, chunkify, }) {
|
|
118
120
|
const cmd = this.device.getCommands();
|
|
119
121
|
if (unlockPath) {
|
|
120
122
|
await cmd.unlockPath(unlockPath);
|
|
@@ -124,6 +126,7 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
124
126
|
show_display,
|
|
125
127
|
multisig,
|
|
126
128
|
script_type,
|
|
129
|
+
chunkify,
|
|
127
130
|
}, coinInfo);
|
|
128
131
|
}
|
|
129
132
|
async run() {
|
|
@@ -16,7 +16,7 @@ export default class NEMGetAddress extends AbstractMethod<'nemGetAddress', Param
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, network, show_display }: Params): Promise<PROTO.NEMAddress>;
|
|
19
|
+
_call({ address_n, network, show_display, chunkify }: Params): Promise<PROTO.NEMAddress>;
|
|
20
20
|
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -31,6 +31,7 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
31
31
|
{ name: 'address', type: 'string' },
|
|
32
32
|
{ name: 'network', type: 'number' },
|
|
33
33
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
34
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
34
35
|
]);
|
|
35
36
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
36
37
|
return {
|
|
@@ -38,6 +39,7 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
38
39
|
network: batch.network || MAINNET,
|
|
39
40
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
40
41
|
address: batch.address,
|
|
42
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
41
43
|
};
|
|
42
44
|
});
|
|
43
45
|
const useEventListener = payload.useEventListener &&
|
|
@@ -96,12 +98,13 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
96
98
|
const uiResp = await uiPromise.promise;
|
|
97
99
|
return uiResp.payload;
|
|
98
100
|
}
|
|
99
|
-
async _call({ address_n, network, show_display }) {
|
|
101
|
+
async _call({ address_n, network, show_display, chunkify }) {
|
|
100
102
|
const cmd = this.device.getCommands();
|
|
101
103
|
const response = await cmd.typedCall('NEMGetAddress', 'NEMAddress', {
|
|
102
104
|
address_n,
|
|
103
105
|
network,
|
|
104
106
|
show_display,
|
|
107
|
+
chunkify,
|
|
105
108
|
});
|
|
106
109
|
return response.message;
|
|
107
110
|
}
|
|
@@ -14,9 +14,10 @@ class NEMSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
14
14
|
(0, paramsValidator_1.validateParams)(payload, [
|
|
15
15
|
{ name: 'path', required: true },
|
|
16
16
|
{ name: 'transaction', required: true },
|
|
17
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
17
18
|
]);
|
|
18
19
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
19
|
-
this.params = helper.createTx(payload.transaction, path);
|
|
20
|
+
this.params = helper.createTx(payload.transaction, path, payload.chunkify);
|
|
20
21
|
}
|
|
21
22
|
get info() {
|
|
22
23
|
return 'Sign NEM transaction';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PROTO } from '../../constants';
|
|
2
2
|
import * as $T from '../../types/api/nem';
|
|
3
|
-
export declare const createTx: (tx: $T.NEMTransaction, address_n: number[]) => PROTO.NEMSignTx;
|
|
3
|
+
export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chunkify?: boolean) => PROTO.NEMSignTx;
|
|
4
4
|
//# sourceMappingURL=nemSignTx.d.ts.map
|
package/lib/api/nem/nemSignTx.js
CHANGED
|
@@ -92,9 +92,10 @@ const supplyChangeMessage = (tx) => ({
|
|
|
92
92
|
type: tx.supplyType,
|
|
93
93
|
delta: tx.delta,
|
|
94
94
|
});
|
|
95
|
-
const createTx = (tx, address_n) => {
|
|
95
|
+
const createTx = (tx, address_n, chunkify) => {
|
|
96
96
|
let transaction = tx;
|
|
97
97
|
const message = {
|
|
98
|
+
chunkify: typeof chunkify === 'boolean' ? chunkify : false,
|
|
98
99
|
transaction: getCommon(tx, address_n),
|
|
99
100
|
transfer: undefined,
|
|
100
101
|
importance_transfer: undefined,
|
|
@@ -16,7 +16,7 @@ export default class RippleGetAddress extends AbstractMethod<'rippleGetAddress',
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display }: Params): Promise<PROTO.RippleAddress>;
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<PROTO.RippleAddress>;
|
|
20
20
|
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -27,12 +27,14 @@ class RippleGetAddress 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 RippleGetAddress 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('RippleGetAddress', 'RippleAddress', {
|
|
85
87
|
address_n,
|
|
86
88
|
show_display,
|
|
89
|
+
chunkify,
|
|
87
90
|
});
|
|
88
91
|
return response.message;
|
|
89
92
|
}
|