@trezor/connect 9.1.5 → 9.1.6

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.
Files changed (157) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +3 -3
  4. package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +6 -6
  5. package/lib/api/{binanceGetPublicKey.d.ts → binance/api/binanceGetPublicKey.d.ts} +3 -3
  6. package/lib/api/{binanceGetPublicKey.js → binance/api/binanceGetPublicKey.js} +5 -5
  7. package/lib/api/{binanceSignTransaction.d.ts → binance/api/binanceSignTransaction.d.ts} +2 -2
  8. package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +5 -5
  9. package/lib/api/binance/api/index.d.ts +4 -0
  10. package/lib/api/binance/api/index.js +13 -0
  11. package/lib/api/bitcoin/TransactionComposer.d.ts +4 -4
  12. package/lib/api/bitcoin/TransactionComposer.js +4 -18
  13. package/lib/api/bitcoin/inputs.d.ts +2 -2
  14. package/lib/api/bitcoin/inputs.js +4 -5
  15. package/lib/api/bitcoin/outputs.d.ts +4 -4
  16. package/lib/api/bitcoin/outputs.js +14 -23
  17. package/lib/api/blockchainEstimateFee.d.ts +2 -2
  18. package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +8 -0
  19. package/lib/api/cardano/api/cardanoComposeTransaction.js +69 -0
  20. package/lib/api/{cardanoGetAddress.d.ts → cardano/api/cardanoGetAddress.d.ts} +3 -3
  21. package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +7 -7
  22. package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts} +3 -3
  23. package/lib/api/{cardanoGetNativeScriptHash.js → cardano/api/cardanoGetNativeScriptHash.js} +5 -5
  24. package/lib/api/{cardanoGetPublicKey.d.ts → cardano/api/cardanoGetPublicKey.d.ts} +3 -3
  25. package/lib/api/{cardanoGetPublicKey.js → cardano/api/cardanoGetPublicKey.js} +6 -6
  26. package/lib/api/{cardanoSignTransaction.d.ts → cardano/api/cardanoSignTransaction.d.ts} +18 -8
  27. package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +30 -13
  28. package/lib/api/cardano/api/index.d.ts +6 -0
  29. package/lib/api/cardano/api/index.js +17 -0
  30. package/lib/api/cardano/cardanoUtils.d.ts +6 -0
  31. package/lib/api/cardano/cardanoUtils.js +64 -1
  32. package/lib/api/composeTransaction.d.ts +5 -5
  33. package/lib/api/composeTransaction.js +14 -19
  34. package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
  35. package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +5 -5
  36. package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +2 -2
  37. package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +5 -5
  38. package/lib/api/eos/api/index.d.ts +3 -0
  39. package/lib/api/eos/api/index.js +11 -0
  40. package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +4 -4
  41. package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +9 -9
  42. package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
  43. package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
  44. package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
  45. package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
  46. package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +11 -9
  47. package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +36 -43
  48. package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
  49. package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
  50. package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
  51. package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
  52. package/lib/api/ethereum/api/index.d.ts +7 -0
  53. package/lib/api/ethereum/api/index.js +19 -0
  54. package/lib/api/ethereum/ethereumSignTx.d.ts +2 -0
  55. package/lib/api/ethereum/ethereumSignTx.js +15 -1
  56. package/lib/api/firmware/verifyAuthenticityProof.js +1 -1
  57. package/lib/api/firmware/x509certificate.d.ts +1 -0
  58. package/lib/api/firmware/x509certificate.js +34 -2
  59. package/lib/api/getAccountDescriptor.d.ts +20 -0
  60. package/lib/api/getAccountDescriptor.js +162 -0
  61. package/lib/api/getAccountInfo.d.ts +2 -0
  62. package/lib/api/index.d.ts +1 -24
  63. package/lib/api/index.js +3 -50
  64. package/lib/api/nem/api/index.d.ts +3 -0
  65. package/lib/api/nem/api/index.js +11 -0
  66. package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +3 -3
  67. package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +6 -6
  68. package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
  69. package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +5 -5
  70. package/lib/api/ripple/api/index.d.ts +3 -0
  71. package/lib/api/ripple/api/index.js +11 -0
  72. package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +3 -3
  73. package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +6 -6
  74. package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
  75. package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +4 -4
  76. package/lib/api/solana/api/index.d.ts +4 -0
  77. package/lib/api/solana/api/index.js +13 -0
  78. package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
  79. package/lib/api/solana/api/solanaGetAddress.js +131 -0
  80. package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
  81. package/lib/api/solana/api/solanaGetPublicKey.js +84 -0
  82. package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
  83. package/lib/api/solana/api/solanaSignTransaction.js +33 -0
  84. package/lib/api/stellar/api/index.d.ts +3 -0
  85. package/lib/api/stellar/api/index.js +11 -0
  86. package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +3 -3
  87. package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +6 -6
  88. package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
  89. package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
  90. package/lib/api/tezos/api/index.d.ts +4 -0
  91. package/lib/api/tezos/api/index.js +13 -0
  92. package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +3 -3
  93. package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +6 -6
  94. package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
  95. package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +5 -5
  96. package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
  97. package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
  98. package/lib/backend/Blockchain.js +2 -0
  99. package/lib/constants/cardano.js +2 -2
  100. package/lib/constants/nem.js +3 -3
  101. package/lib/constants/network.d.ts +3 -0
  102. package/lib/constants/network.js +13 -1
  103. package/lib/core/index.d.ts +3 -1
  104. package/lib/core/index.js +17 -4
  105. package/lib/core/method.d.ts +2 -2
  106. package/lib/core/method.js +8 -2
  107. package/lib/core/method.native.d.ts +5 -0
  108. package/lib/core/method.native.js +34 -0
  109. package/lib/data/DataManager.d.ts +11 -0
  110. package/lib/data/config.d.ts +11 -0
  111. package/lib/data/config.js +4 -0
  112. package/lib/data/connectSettings.js +4 -0
  113. package/lib/data/defaultFeeLevels.js +8 -0
  114. package/lib/data/version.d.ts +1 -1
  115. package/lib/data/version.js +1 -1
  116. package/lib/device/Device.d.ts +1 -1
  117. package/lib/device/Device.js +11 -2
  118. package/lib/device/DeviceCommands.js +9 -0
  119. package/lib/device/DeviceList.js +4 -1
  120. package/lib/events/popup.d.ts +19 -3
  121. package/lib/events/popup.js +3 -0
  122. package/lib/factory.js +5 -0
  123. package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
  124. package/lib/types/api/cardanoComposeTransaction.js +3 -0
  125. package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
  126. package/lib/types/api/composeTransaction.d.ts +28 -54
  127. package/lib/types/api/ethereum/index.d.ts +1 -0
  128. package/lib/types/api/getAccountDescriptor.d.ts +16 -0
  129. package/lib/types/api/getAccountDescriptor.js +3 -0
  130. package/lib/types/api/index.d.ts +10 -0
  131. package/lib/types/api/solana/index.d.ts +12 -0
  132. package/lib/types/api/solana/index.js +3 -0
  133. package/lib/types/api/solanaGetAddress.d.ts +4 -0
  134. package/lib/types/api/solanaGetAddress.js +3 -0
  135. package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
  136. package/lib/types/api/solanaGetPublicKey.js +3 -0
  137. package/lib/types/api/solanaSignTransaction.d.ts +4 -0
  138. package/lib/types/api/solanaSignTransaction.js +3 -0
  139. package/lib/types/coinInfo.d.ts +2 -13
  140. package/lib/types/device.js +1 -1
  141. package/lib/types/index.d.ts +3 -1
  142. package/lib/types/index.js +1 -0
  143. package/lib/types/settings.d.ts +1 -0
  144. package/lib/utils/debug.d.ts +1 -2
  145. package/lib/utils/debug.js +6 -1
  146. package/lib/utils/deviceFeaturesUtils.js +2 -0
  147. package/lib/utils/formatUtils.d.ts +2 -0
  148. package/lib/utils/formatUtils.js +19 -1
  149. package/lib/workers/workers-browser.d.ts +2 -1
  150. package/lib/workers/workers-browser.js +3 -1
  151. package/lib/workers/workers-react-native.d.ts +2 -1
  152. package/lib/workers/workers-react-native.js +3 -1
  153. package/lib/workers/workers.d.ts +8 -5
  154. package/lib/workers/workers.js +34 -10
  155. package/package.json +22 -18
  156. package/lib/api/eosGetPublicKey.d.ts +0 -11
  157. package/lib/api/ethereumGetPublicKey.d.ts +0 -16
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
- const coinInfo_1 = require("../data/coinInfo");
6
- const pathUtils_1 = require("../utils/pathUtils");
7
- const cardanoAuxiliaryData_1 = require("./cardano/cardanoAuxiliaryData");
8
- const cardanoCertificate_1 = require("./cardano/cardanoCertificate");
9
- const cardanoInputs_1 = require("./cardano/cardanoInputs");
10
- const cardanoOutputs_1 = require("./cardano/cardanoOutputs");
11
- const constants_1 = require("../constants");
12
- const cardanoWitnesses_1 = require("./cardano/cardanoWitnesses");
13
- const cardanoTokenBundle_1 = require("./cardano/cardanoTokenBundle");
3
+ const coin_selection_1 = require("@fivebinaries/coin-selection");
4
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
5
+ const paramsValidator_1 = require("../../common/paramsValidator");
6
+ const coinInfo_1 = require("../../../data/coinInfo");
7
+ const pathUtils_1 = require("../../../utils/pathUtils");
8
+ const cardanoAuxiliaryData_1 = require("../cardanoAuxiliaryData");
9
+ const cardanoCertificate_1 = require("../cardanoCertificate");
10
+ const cardanoInputs_1 = require("../cardanoInputs");
11
+ const cardanoOutputs_1 = require("../cardanoOutputs");
12
+ const constants_1 = require("../../../constants");
13
+ const cardanoWitnesses_1 = require("../cardanoWitnesses");
14
+ const cardanoTokenBundle_1 = require("../cardanoTokenBundle");
14
15
  const CardanoSignTransactionFeatures = Object.freeze({
15
16
  TransactionStreaming: ['0', '2.4.2'],
16
17
  TokenMinting: ['0', '2.4.3'],
@@ -65,6 +66,8 @@ class CardanoSignTransaction extends AbstractMethod_1.AbstractMethod {
65
66
  { name: 'additionalWitnessRequests', type: 'array', allowEmpty: true },
66
67
  { name: 'derivationType', type: 'number' },
67
68
  { name: 'includeNetworkId', type: 'boolean' },
69
+ { name: 'unsignedTx', type: 'object' },
70
+ { name: 'testnet', type: 'boolean' },
68
71
  ]);
69
72
  const inputsWithPath = payload.inputs.map(cardanoInputs_1.transformInput);
70
73
  const outputsWithData = payload.outputs.map(cardanoOutputs_1.transformOutput);
@@ -148,6 +151,8 @@ class CardanoSignTransaction extends AbstractMethod_1.AbstractMethod {
148
151
  ? payload.derivationType
149
152
  : constants_1.PROTO.CardanoDerivationType.ICARUS_TREZOR,
150
153
  includeNetworkId: payload.includeNetworkId,
154
+ unsignedTx: 'unsignedTx' in payload ? payload.unsignedTx : undefined,
155
+ testnet: 'testnet' in payload ? payload.testnet : undefined,
151
156
  };
152
157
  }
153
158
  get info() {
@@ -329,9 +334,21 @@ class CardanoSignTransaction extends AbstractMethod_1.AbstractMethod {
329
334
  await typedCall('CardanoTxHostAck', 'CardanoSignTxFinished');
330
335
  return { hash: txBodyHashMessage.tx_hash, witnesses, auxiliaryDataSupplement };
331
336
  }
332
- run() {
337
+ async run() {
333
338
  this._ensureFirmwareSupportsParams();
334
- return this._sign_tx();
339
+ const result = await this._sign_tx();
340
+ if (!this.params.unsignedTx)
341
+ return result;
342
+ const { unsignedTx, testnet } = this.params;
343
+ const { hash, witnesses } = result;
344
+ if (hash !== unsignedTx.hash) {
345
+ throw constants_1.ERRORS.TypedError('Runtime', "Constructed transaction doesn't match the hash returned by the device.");
346
+ }
347
+ const serializedTx = coin_selection_1.trezorUtils.signTransaction(unsignedTx.body, witnesses, { testnet });
348
+ return {
349
+ ...result,
350
+ serializedTx,
351
+ };
335
352
  }
336
353
  }
337
354
  exports.default = CardanoSignTransaction;
@@ -0,0 +1,6 @@
1
+ export { default as cardanoGetAddress } from './cardanoGetAddress';
2
+ export { default as cardanoGetNativeScriptHash } from './cardanoGetNativeScriptHash';
3
+ export { default as cardanoGetPublicKey } from './cardanoGetPublicKey';
4
+ export { default as cardanoSignTransaction } from './cardanoSignTransaction';
5
+ export { default as cardanoComposeTransaction } from './cardanoComposeTransaction';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.cardanoComposeTransaction = exports.cardanoSignTransaction = exports.cardanoGetPublicKey = exports.cardanoGetNativeScriptHash = exports.cardanoGetAddress = void 0;
7
+ var cardanoGetAddress_1 = require("./cardanoGetAddress");
8
+ Object.defineProperty(exports, "cardanoGetAddress", { enumerable: true, get: function () { return __importDefault(cardanoGetAddress_1).default; } });
9
+ var cardanoGetNativeScriptHash_1 = require("./cardanoGetNativeScriptHash");
10
+ Object.defineProperty(exports, "cardanoGetNativeScriptHash", { enumerable: true, get: function () { return __importDefault(cardanoGetNativeScriptHash_1).default; } });
11
+ var cardanoGetPublicKey_1 = require("./cardanoGetPublicKey");
12
+ Object.defineProperty(exports, "cardanoGetPublicKey", { enumerable: true, get: function () { return __importDefault(cardanoGetPublicKey_1).default; } });
13
+ var cardanoSignTransaction_1 = require("./cardanoSignTransaction");
14
+ Object.defineProperty(exports, "cardanoSignTransaction", { enumerable: true, get: function () { return __importDefault(cardanoSignTransaction_1).default; } });
15
+ var cardanoComposeTransaction_1 = require("./cardanoComposeTransaction");
16
+ Object.defineProperty(exports, "cardanoComposeTransaction", { enumerable: true, get: function () { return __importDefault(cardanoComposeTransaction_1).default; } });
17
+ //# sourceMappingURL=index.js.map
@@ -1,3 +1,9 @@
1
+ import { types } from '@fivebinaries/coin-selection';
2
+ import { AccountUtxo, CardanoCertificate } from '../../types';
3
+ export declare const transformUtxos: (utxos: AccountUtxo[]) => types.Utxo[];
4
+ export declare const prepareCertificates: (certs: CardanoCertificate[]) => types.Certificate[];
5
+ export declare const getTtl: (testnet: boolean) => number;
6
+ export declare const composeTxPlan: (descriptor: string, utxo: AccountUtxo[], outputs: types.UserOutput[], certificates: CardanoCertificate[], withdrawals: types.Withdrawal[], changeAddress: string, isTestnet: boolean, options?: types.Options) => types.PrecomposedTransaction;
1
7
  export declare const hexStringByteLength: (s: string) => number;
2
8
  export declare const sendChunkedHexString: (typedCall: any, data: string, chunkSize: number, messageType: string) => Promise<void>;
3
9
  //# sourceMappingURL=cardanoUtils.d.ts.map
@@ -1,6 +1,69 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sendChunkedHexString = exports.hexStringByteLength = void 0;
3
+ exports.sendChunkedHexString = exports.hexStringByteLength = exports.composeTxPlan = exports.getTtl = exports.prepareCertificates = exports.transformUtxos = void 0;
4
+ const coin_selection_1 = require("@fivebinaries/coin-selection");
5
+ const constants_1 = require("../../constants");
6
+ const CARDANO_DEFAULT_TTL_OFFSET = 7200;
7
+ const transformUtxos = (utxos) => {
8
+ const result = [];
9
+ utxos === null || utxos === void 0 ? void 0 : utxos.forEach(utxo => {
10
+ const foundItem = result.find(res => res.txHash === utxo.txid && res.outputIndex === utxo.vout);
11
+ if (utxo.cardanoSpecific) {
12
+ if (!foundItem) {
13
+ result.push({
14
+ address: utxo.address,
15
+ txHash: utxo.txid,
16
+ outputIndex: utxo.vout,
17
+ amount: [{ quantity: utxo.amount, unit: utxo.cardanoSpecific.unit }],
18
+ });
19
+ }
20
+ else {
21
+ foundItem.amount.push({ quantity: utxo.amount, unit: utxo.cardanoSpecific.unit });
22
+ }
23
+ }
24
+ });
25
+ return result;
26
+ };
27
+ exports.transformUtxos = transformUtxos;
28
+ const prepareCertificates = (certs) => {
29
+ const convertedCerts = [];
30
+ certs.forEach(cert => {
31
+ switch (cert.type) {
32
+ case constants_1.PROTO.CardanoCertificateType.STAKE_DELEGATION:
33
+ convertedCerts.push({
34
+ type: cert.type,
35
+ pool: cert.pool,
36
+ });
37
+ break;
38
+ case constants_1.PROTO.CardanoCertificateType.STAKE_REGISTRATION:
39
+ case constants_1.PROTO.CardanoCertificateType.STAKE_DEREGISTRATION:
40
+ convertedCerts.push({
41
+ type: cert.type,
42
+ });
43
+ break;
44
+ }
45
+ });
46
+ return convertedCerts;
47
+ };
48
+ exports.prepareCertificates = prepareCertificates;
49
+ const getTtl = (testnet) => {
50
+ const shelleySlot = testnet ? 6192449 : 4924800;
51
+ const shelleyTimestamp = testnet ? 1672848449 : 1596491091;
52
+ const currentTimestamp = Math.floor(new Date().getTime() / 1000);
53
+ const currentSlot = shelleySlot + currentTimestamp - shelleyTimestamp;
54
+ return currentSlot + CARDANO_DEFAULT_TTL_OFFSET;
55
+ };
56
+ exports.getTtl = getTtl;
57
+ const composeTxPlan = (descriptor, utxo, outputs, certificates, withdrawals, changeAddress, isTestnet, options) => (0, coin_selection_1.coinSelection)({
58
+ utxos: (0, exports.transformUtxos)(utxo),
59
+ outputs,
60
+ changeAddress,
61
+ certificates: (0, exports.prepareCertificates)(certificates),
62
+ withdrawals,
63
+ accountPubKey: descriptor,
64
+ ttl: (0, exports.getTtl)(isTestnet),
65
+ }, options);
66
+ exports.composeTxPlan = composeTxPlan;
4
67
  const hexStringByteLength = (s) => s.length / 2;
5
68
  exports.hexStringByteLength = hexStringByteLength;
6
69
  const sendChunkedHexString = async (typedCall, data, chunkSize, messageType) => {
@@ -2,9 +2,9 @@ import BigNumber from 'bignumber.js';
2
2
  import { AbstractMethod } from '../core/AbstractMethod';
3
3
  import { Discovery } from './common/Discovery';
4
4
  import { TransactionComposer } from './bitcoin';
5
- import type { ComposeOutput, ComposeResult } from '@trezor/utxo-lib';
5
+ import type { ComposeOutput } from '@trezor/utxo-lib';
6
6
  import type { BitcoinNetworkInfo, DiscoveryAccount, AccountUtxo } from '../types';
7
- import type { SignedTransaction, PrecomposeParams, PrecomposedTransaction } from '../types/api/composeTransaction';
7
+ import type { SignedTransaction, PrecomposeParams, ComposeResult, PrecomposedResult } from '../types/api/composeTransaction';
8
8
  type Params = {
9
9
  outputs: ComposeOutput[];
10
10
  coinInfo: BitcoinNetworkInfo;
@@ -21,13 +21,13 @@ export default class ComposeTransaction extends AbstractMethod<'composeTransacti
21
21
  discovery?: Discovery;
22
22
  init(): void;
23
23
  get info(): string;
24
- precompose(account: PrecomposeParams['account'], feeLevels: PrecomposeParams['feeLevels']): Promise<PrecomposedTransaction[]>;
25
- run(): Promise<SignedTransaction | PrecomposedTransaction[]>;
24
+ precompose(account: PrecomposeParams['account'], feeLevels: PrecomposeParams['feeLevels']): Promise<PrecomposedResult[]>;
25
+ run(): Promise<SignedTransaction | PrecomposedResult[]>;
26
26
  selectAccount(): Promise<{
27
27
  account: DiscoveryAccount;
28
28
  utxo: AccountUtxo[];
29
29
  }>;
30
- selectFee(account: DiscoveryAccount, utxo: AccountUtxo[]): Promise<SignedTransaction | "change-account">;
30
+ selectFee(account: DiscoveryAccount, utxos: AccountUtxo[]): Promise<SignedTransaction | "change-account">;
31
31
  _selectFeeUiResponse(composer: TransactionComposer): Promise<SignedTransaction | 'change-account'>;
32
32
  _sign(tx: ComposeResult): Promise<import("../types").SignedTransaction>;
33
33
  dispose(): void;
@@ -77,7 +77,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
77
77
  address_n,
78
78
  addresses: account.addresses,
79
79
  },
80
- utxo: account.utxo,
80
+ utxos: account.utxo,
81
81
  coinInfo,
82
82
  outputs,
83
83
  baseFee,
@@ -89,21 +89,16 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
89
89
  composer.composeCustomFee(level.feePerUnit);
90
90
  const tx = { ...composer.composed.custom };
91
91
  if (tx.type === 'final') {
92
- const inputs = tx.transaction.inputs.map(inp => (0, bitcoin_1.inputToTrezor)(inp, this.params.sequence || 0xffffffff));
93
- const { sorted, permutation } = tx.transaction.outputs;
94
- const txOutputs = sorted.map(out => (0, bitcoin_1.outputToTrezor)(out, coinInfo));
95
92
  return {
96
- type: 'final',
97
- max: tx.max,
98
- totalSpent: tx.totalSpent,
99
- fee: tx.fee,
100
- feePerByte: tx.feePerByte,
101
- bytes: tx.bytes,
102
- transaction: {
103
- inputs,
104
- outputs: txOutputs,
105
- outputsPermutation: permutation,
106
- },
93
+ ...tx,
94
+ inputs: tx.inputs.map(inp => (0, bitcoin_1.inputToTrezor)(inp, this.params.sequence)),
95
+ outputs: tx.outputs.map(bitcoin_1.outputToTrezor),
96
+ };
97
+ }
98
+ if (tx.type === 'nonfinal') {
99
+ return {
100
+ ...tx,
101
+ inputs: tx.inputs.map(inp => (0, bitcoin_1.inputToTrezor)(inp, this.params.sequence)),
107
102
  };
108
103
  }
109
104
  return tx;
@@ -184,12 +179,12 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
184
179
  utxo,
185
180
  };
186
181
  }
187
- async selectFee(account, utxo) {
182
+ async selectFee(account, utxos) {
188
183
  const { coinInfo, outputs } = this.params;
189
184
  const blockchain = await (0, BlockchainLink_1.initBlockchain)(coinInfo, this.postMessage);
190
185
  const composer = new bitcoin_1.TransactionComposer({
191
186
  account,
192
- utxo,
187
+ utxos,
193
188
  coinInfo,
194
189
  outputs,
195
190
  });
@@ -227,8 +222,8 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
227
222
  throw constants_1.ERRORS.TypedError('Runtime', 'ComposeTransaction: Trying to sign unfinished tx');
228
223
  const { coinInfo } = this.params;
229
224
  const options = (0, bitcoin_1.enhanceSignTx)({}, coinInfo);
230
- const inputs = tx.transaction.inputs.map(inp => (0, bitcoin_1.inputToTrezor)(inp, this.params.sequence || 0xffffffff));
231
- const outputs = tx.transaction.outputs.sorted.map(out => (0, bitcoin_1.outputToTrezor)(out, coinInfo));
225
+ const inputs = tx.inputs.map(inp => (0, bitcoin_1.inputToTrezor)(inp, this.params.sequence));
226
+ const outputs = tx.outputs.map(bitcoin_1.outputToTrezor);
232
227
  let refTxs = [];
233
228
  const requiredRefTxs = (0, bitcoin_1.requireReferencedTransactions)(inputs, options, coinInfo);
234
229
  const refTxsIds = (0, bitcoin_1.getReferencedTransactions)(inputs);
@@ -0,0 +1,11 @@
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import type { PROTO } from '../../../constants';
3
+ export default class EosGetPublicKey extends AbstractMethod<'eosGetPublicKey', PROTO.EosGetPublicKey[]> {
4
+ hasBundle?: boolean;
5
+ confirmed?: boolean;
6
+ init(): void;
7
+ get info(): string;
8
+ confirmation(): Promise<boolean>;
9
+ run(): Promise<import("../../..").EosPublicKey | import("../../..").EosPublicKey[]>;
10
+ }
11
+ //# sourceMappingURL=eosGetPublicKey.d.ts.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
- const coinInfo_1 = require("../data/coinInfo");
6
- const pathUtils_1 = require("../utils/pathUtils");
7
- const events_1 = require("../events");
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const coinInfo_1 = require("../../../data/coinInfo");
6
+ const pathUtils_1 = require("../../../utils/pathUtils");
7
+ const events_1 = require("../../../events");
8
8
  class EosGetPublicKey extends AbstractMethod_1.AbstractMethod {
9
9
  init() {
10
10
  this.requiredPermissions = ['read'];
@@ -1,5 +1,5 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { PROTO } from '../constants';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import type { PROTO } from '../../../constants';
3
3
  type Params = {
4
4
  path: number[];
5
5
  chain_id: string;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const AbstractMethod_1 = require("../core/AbstractMethod");
5
- const paramsValidator_1 = require("./common/paramsValidator");
6
- const coinInfo_1 = require("../data/coinInfo");
7
- const pathUtils_1 = require("../utils/pathUtils");
8
- const helper = tslib_1.__importStar(require("./eos/eosSignTx"));
4
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
5
+ const paramsValidator_1 = require("../../common/paramsValidator");
6
+ const coinInfo_1 = require("../../../data/coinInfo");
7
+ const pathUtils_1 = require("../../../utils/pathUtils");
8
+ const helper = tslib_1.__importStar(require("../eosSignTx"));
9
9
  class EosSignTransaction extends AbstractMethod_1.AbstractMethod {
10
10
  init() {
11
11
  this.requiredPermissions = ['read', 'write'];
@@ -0,0 +1,3 @@
1
+ export { default as eosGetPublicKey } from './eosGetPublicKey';
2
+ export { default as eosSignTransaction } from './eosSignTransaction';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.eosSignTransaction = exports.eosGetPublicKey = void 0;
7
+ var eosGetPublicKey_1 = require("./eosGetPublicKey");
8
+ Object.defineProperty(exports, "eosGetPublicKey", { enumerable: true, get: function () { return __importDefault(eosGetPublicKey_1).default; } });
9
+ var eosSignTransaction_1 = require("./eosSignTransaction");
10
+ Object.defineProperty(exports, "eosSignTransaction", { enumerable: true, get: function () { return __importDefault(eosSignTransaction_1).default; } });
11
+ //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import { PROTO } from '../constants';
3
- import type { EthereumNetworkInfo } from '../types';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import { PROTO } from '../../../constants';
3
+ import type { EthereumNetworkInfo } from '../../../types';
4
4
  type Params = PROTO.EthereumGetAddress & {
5
5
  address?: string;
6
6
  network?: EthereumNetworkInfo;
@@ -25,7 +25,7 @@ export default class EthereumGetAddress extends AbstractMethod<'ethereumGetAddre
25
25
  serializedPath: string;
26
26
  address: string;
27
27
  }>;
28
- run(): Promise<import("../types").Address | import("../types").Address[]>;
28
+ run(): Promise<import("../../../types").Address | import("../../../types").Address[]>;
29
29
  }
30
30
  export {};
31
31
  //# sourceMappingURL=ethereumGetAddress.d.ts.map
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
- const pathUtils_1 = require("../utils/pathUtils");
6
- const ethereumUtils_1 = require("../utils/ethereumUtils");
7
- const coinInfo_1 = require("../data/coinInfo");
8
- const formatUtils_1 = require("../utils/formatUtils");
9
- const constants_1 = require("../constants");
10
- const events_1 = require("../events");
11
- const ethereumDefinitions_1 = require("./ethereum/ethereumDefinitions");
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const pathUtils_1 = require("../../../utils/pathUtils");
6
+ const ethereumUtils_1 = require("../../../utils/ethereumUtils");
7
+ const coinInfo_1 = require("../../../data/coinInfo");
8
+ const formatUtils_1 = require("../../../utils/formatUtils");
9
+ const constants_1 = require("../../../constants");
10
+ const events_1 = require("../../../events");
11
+ const ethereumDefinitions_1 = require("../ethereumDefinitions");
12
12
  class EthereumGetAddress extends AbstractMethod_1.AbstractMethod {
13
13
  constructor() {
14
14
  super(...arguments);
@@ -0,0 +1,16 @@
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import type { PROTO } from '../../../constants';
3
+ import type { EthereumNetworkInfo } from '../../../types';
4
+ type Params = PROTO.EthereumGetPublicKey & {
5
+ network?: EthereumNetworkInfo;
6
+ };
7
+ export default class EthereumGetPublicKey extends AbstractMethod<'ethereumGetPublicKey', Params[]> {
8
+ hasBundle?: boolean;
9
+ confirmed?: boolean;
10
+ init(): void;
11
+ get info(): string;
12
+ confirmation(): Promise<boolean>;
13
+ run(): Promise<import("../../../types/api/getPublicKey").HDNodeResponse | import("../../../types/api/getPublicKey").HDNodeResponse[]>;
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=ethereumGetPublicKey.d.ts.map
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
- const pathUtils_1 = require("../utils/pathUtils");
6
- const ethereumUtils_1 = require("../utils/ethereumUtils");
7
- const coinInfo_1 = require("../data/coinInfo");
8
- const events_1 = require("../events");
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const pathUtils_1 = require("../../../utils/pathUtils");
6
+ const ethereumUtils_1 = require("../../../utils/ethereumUtils");
7
+ const coinInfo_1 = require("../../../data/coinInfo");
8
+ const events_1 = require("../../../events");
9
9
  class EthereumGetPublicKey extends AbstractMethod_1.AbstractMethod {
10
10
  init() {
11
11
  this.requiredPermissions = ['read'];
@@ -1,6 +1,6 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { PROTO } from '../constants';
3
- import type { EthereumNetworkInfo } from '../types';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import type { PROTO } from '../../../constants';
3
+ import type { EthereumNetworkInfo } from '../../../types';
4
4
  import type { EthereumDefinitions } from '@trezor/protobuf/lib/messages';
5
5
  type Params = PROTO.EthereumSignMessage & {
6
6
  network?: EthereumNetworkInfo;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
- const pathUtils_1 = require("../utils/pathUtils");
6
- const coinInfo_1 = require("../data/coinInfo");
7
- const ethereumUtils_1 = require("../utils/ethereumUtils");
8
- const formatUtils_1 = require("../utils/formatUtils");
9
- const ethereumDefinitions_1 = require("./ethereum/ethereumDefinitions");
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const pathUtils_1 = require("../../../utils/pathUtils");
6
+ const coinInfo_1 = require("../../../data/coinInfo");
7
+ const ethereumUtils_1 = require("../../../utils/ethereumUtils");
8
+ const formatUtils_1 = require("../../../utils/formatUtils");
9
+ const ethereumDefinitions_1 = require("../ethereumDefinitions");
10
10
  class EthereumSignMessage extends AbstractMethod_1.AbstractMethod {
11
11
  init() {
12
12
  this.requiredPermissions = ['read', 'write'];
@@ -1,22 +1,24 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { EthereumTransaction, EthereumTransactionEIP1559 } from '../types/api/ethereum';
3
- import type { EthereumNetworkInfo } from '../types';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import type { EthereumTransaction, EthereumTransactionEIP1559 } from '../../../types/api/ethereum';
3
+ import type { EthereumNetworkInfo } from '../../../types';
4
4
  import type { EthereumDefinitions } from '@trezor/protobuf/lib/messages';
5
5
  type Params = {
6
6
  path: number[];
7
- tx: ({
8
- type: 'legacy';
9
- } & EthereumTransaction) | ({
10
- type: 'eip1559';
11
- } & EthereumTransactionEIP1559);
12
7
  network?: EthereumNetworkInfo;
13
8
  definitions?: EthereumDefinitions;
14
- };
9
+ } & ({
10
+ type: 'legacy';
11
+ tx: EthereumTransaction;
12
+ } | {
13
+ type: 'eip1559';
14
+ tx: EthereumTransactionEIP1559;
15
+ });
15
16
  export default class EthereumSignTransaction extends AbstractMethod<'ethereumSignTransaction', Params> {
16
17
  init(): void;
17
18
  initAsync(): Promise<void>;
18
19
  get info(): string;
19
20
  run(): Promise<{
21
+ serializedTx: string;
20
22
  v: string;
21
23
  r: string;
22
24
  s: string;
@@ -1,30 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const AbstractMethod_1 = require("../core/AbstractMethod");
5
- const paramsValidator_1 = require("./common/paramsValidator");
6
- const pathUtils_1 = require("../utils/pathUtils");
7
- const coinInfo_1 = require("../data/coinInfo");
8
- const ethereumUtils_1 = require("../utils/ethereumUtils");
9
- const formatUtils_1 = require("../utils/formatUtils");
10
- const helper = tslib_1.__importStar(require("./ethereum/ethereumSignTx"));
11
- const ethereumDefinitions_1 = require("./ethereum/ethereumDefinitions");
12
- const strip = value => {
13
- if (typeof value === 'string') {
14
- let stripped = (0, formatUtils_1.stripHexPrefix)(value);
15
- if (stripped.length % 2 !== 0) {
16
- stripped = `0${stripped}`;
17
- }
18
- return stripped;
19
- }
20
- if (Array.isArray(value)) {
21
- return value.map(strip);
22
- }
23
- if (typeof value === 'object') {
24
- return Object.entries(value).reduce((acc, [k, v]) => ({ ...acc, [k]: strip(v) }), {});
4
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
5
+ const paramsValidator_1 = require("../../common/paramsValidator");
6
+ const pathUtils_1 = require("../../../utils/pathUtils");
7
+ const coinInfo_1 = require("../../../data/coinInfo");
8
+ const ethereumUtils_1 = require("../../../utils/ethereumUtils");
9
+ const formatUtils_1 = require("../../../utils/formatUtils");
10
+ const helper = tslib_1.__importStar(require("../ethereumSignTx"));
11
+ const ethereumDefinitions_1 = require("../ethereumDefinitions");
12
+ const strip = (0, formatUtils_1.deepTransform)(value => {
13
+ let stripped = (0, formatUtils_1.stripHexPrefix)(value);
14
+ if (stripped.length % 2 !== 0) {
15
+ stripped = `0${stripped}`;
25
16
  }
26
- return value;
27
- };
17
+ return stripped;
18
+ });
28
19
  class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
29
20
  init() {
30
21
  this.requiredPermissions = ['read', 'write'];
@@ -36,10 +27,10 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
36
27
  const path = (0, pathUtils_1.validatePath)(payload.path, 3);
37
28
  const network = (0, coinInfo_1.getEthereumNetwork)(path);
38
29
  const tx = payload.transaction;
39
- const isEIP1559 = tx.maxFeePerGas && tx.maxPriorityFeePerGas;
30
+ const isEIP1559 = typeof tx.maxFeePerGas === 'string' && typeof tx.maxPriorityFeePerGas === 'string';
40
31
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(isEIP1559 ? 'eip1559' : this.name, network, this.firmwareRange);
41
- const schema = isEIP1559
42
- ? [
32
+ if (isEIP1559) {
33
+ (0, paramsValidator_1.validateParams)(tx, [
43
34
  { name: 'to', type: 'string', required: true },
44
35
  { name: 'value', type: 'string', required: true },
45
36
  { name: 'gasLimit', type: 'string', required: true },
@@ -48,8 +39,11 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
48
39
  { name: 'nonce', type: 'string', required: true },
49
40
  { name: 'data', type: 'string' },
50
41
  { name: 'chainId', type: 'number', required: true },
51
- ]
52
- : [
42
+ ]);
43
+ this.params = { path, network, type: 'eip1559', tx: strip(tx) };
44
+ }
45
+ else {
46
+ (0, paramsValidator_1.validateParams)(tx, [
53
47
  { name: 'to', type: 'string', required: true },
54
48
  { name: 'value', type: 'string', required: true },
55
49
  { name: 'gasLimit', type: 'string', required: true },
@@ -58,19 +52,12 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
58
52
  { name: 'data', type: 'string' },
59
53
  { name: 'chainId', type: 'number' },
60
54
  { name: 'txType', type: 'number' },
61
- ];
62
- (0, paramsValidator_1.validateParams)(tx, schema);
55
+ ]);
56
+ this.params = { path, network, type: 'legacy', tx: strip(tx) };
57
+ }
63
58
  if (typeof tx.chainId !== 'number') {
64
59
  console.warn('TrezorConnect.ethereumSignTransaction: Missing chainId parameter!');
65
60
  }
66
- this.params = {
67
- path,
68
- tx: {
69
- type: isEIP1559 ? 'eip1559' : 'legacy',
70
- ...strip(tx),
71
- },
72
- network,
73
- };
74
61
  }
75
62
  async initAsync() {
76
63
  if (this.params.tx.chainId === 1 && !this.params.tx.data) {
@@ -91,11 +78,17 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
91
78
  get info() {
92
79
  return (0, ethereumUtils_1.getNetworkLabel)('Sign #NETWORK transaction', this.params.network);
93
80
  }
94
- run() {
95
- const { tx, definitions } = this.params;
96
- return tx.type === 'eip1559'
97
- ? 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)
98
- : 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);
81
+ async run() {
82
+ const { type, tx, definitions } = this.params;
83
+ 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
+ const serializedTx = helper.serializeEthereumTx({
87
+ ...tx,
88
+ ...signature,
89
+ type: type === 'legacy' ? 0 : 2,
90
+ }, tx.chainId);
91
+ return { ...signature, serializedTx };
99
92
  }
100
93
  }
101
94
  exports.default = EthereumSignTransaction;
@@ -1,6 +1,6 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { EthereumSignTypedDataTypes, EthereumSignTypedData as EthereumSignTypedDataParams, EthereumSignTypedHash as EthereumSignTypedHashParams } from '../types/api/ethereum';
3
- import type { EthereumNetworkInfo } from '../types';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import type { EthereumSignTypedDataTypes, EthereumSignTypedData as EthereumSignTypedDataParams, EthereumSignTypedHash as EthereumSignTypedHashParams } from '../../../types/api/ethereum';
3
+ import type { EthereumNetworkInfo } from '../../../types';
4
4
  import type { EthereumDefinitions } from '@trezor/protobuf/lib/messages';
5
5
  type Params = (Omit<EthereumSignTypedDataParams<EthereumSignTypedDataTypes>, 'path'> | Omit<EthereumSignTypedHashParams<EthereumSignTypedDataTypes>, 'path'>) & {
6
6
  address_n: number[];