@trezor/connect 9.0.0-beta.4 → 9.0.0-beta.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.
Files changed (157) hide show
  1. package/README.md +37 -14
  2. package/lib/api/binance/binanceSignTx.d.ts +1 -1
  3. package/lib/api/binanceSignTransaction.d.ts +1 -1
  4. package/lib/api/binanceSignTransaction.js +1 -1
  5. package/lib/api/bitcoin/Fees.js +1 -1
  6. package/lib/api/bitcoin/TransactionComposer.js +1 -1
  7. package/lib/api/bitcoin/enhanceSignTx.d.ts +1 -1
  8. package/lib/api/bitcoin/index.js +9 -9
  9. package/lib/api/bitcoin/refTx.d.ts +3 -3
  10. package/lib/api/bitcoin/signtx.d.ts +1 -1
  11. package/lib/api/bitcoin/signtxLegacy.d.ts +1 -1
  12. package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -1
  13. package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -1
  14. package/lib/api/cardano/cardanoCertificate.d.ts +1 -1
  15. package/lib/api/cardano/cardanoInputs.d.ts +1 -0
  16. package/lib/api/cardano/cardanoInputs.js +12 -1
  17. package/lib/api/cardano/cardanoOutputs.d.ts +6 -3
  18. package/lib/api/cardano/cardanoOutputs.js +37 -1
  19. package/lib/api/cardano/cardanoTokenBundle.d.ts +1 -1
  20. package/lib/api/cardano/cardanoUtils.d.ts +3 -0
  21. package/lib/api/cardano/cardanoUtils.js +17 -0
  22. package/lib/api/cardano/cardanoWitnesses.js +4 -4
  23. package/lib/api/cardanoGetAddress.d.ts +1 -1
  24. package/lib/api/cardanoGetNativeScriptHash.d.ts +1 -1
  25. package/lib/api/cardanoGetPublicKey.d.ts +1 -1
  26. package/lib/api/cardanoSignTransaction.d.ts +8 -4
  27. package/lib/api/cardanoSignTransaction.js +40 -17
  28. package/lib/api/common/Discovery.js +1 -1
  29. package/lib/api/common/paramsValidator.d.ts +1 -1
  30. package/lib/api/composeTransaction.d.ts +1 -1
  31. package/lib/api/composeTransaction.js +2 -2
  32. package/lib/api/eos/eosSignTx.d.ts +1 -1
  33. package/lib/api/eos/eosSignTx.js +1 -1
  34. package/lib/api/eosGetPublicKey.d.ts +1 -1
  35. package/lib/api/eosSignTransaction.js +1 -1
  36. package/lib/api/ethereum/__fixtures__/ethereumSignTypedData.js +1 -1
  37. package/lib/api/ethereum/ethereumSignTx.d.ts +3 -3
  38. package/lib/api/ethereum/ethereumSignTypedData.d.ts +1 -1
  39. package/lib/api/ethereum/ethereumSignTypedData.js +1 -1
  40. package/lib/api/ethereumSignTransaction.d.ts +1 -1
  41. package/lib/api/ethereumSignTransaction.js +1 -1
  42. package/lib/api/ethereumSignTypedData.d.ts +1 -1
  43. package/lib/api/firmware/calculateFirmwareHash.d.ts +6 -0
  44. package/lib/api/firmware/calculateFirmwareHash.js +26 -0
  45. package/lib/api/firmware/getBinary.d.ts +2 -2
  46. package/lib/api/firmware/getBinary.js +2 -3
  47. package/lib/api/firmware/index.d.ts +5 -0
  48. package/lib/api/firmware/index.js +13 -0
  49. package/lib/api/firmware/modifyFirmware.d.ts +3 -5
  50. package/lib/api/firmware/modifyFirmware.js +12 -10
  51. package/lib/api/{management → firmware}/uploadFirmware.d.ts +0 -0
  52. package/lib/api/{management → firmware}/uploadFirmware.js +0 -0
  53. package/lib/api/firmwareUpdate.d.ts +4 -1
  54. package/lib/api/firmwareUpdate.js +8 -13
  55. package/lib/api/getFirmwareHash.d.ts +7 -0
  56. package/lib/api/getFirmwareHash.js +29 -0
  57. package/lib/api/index.d.ts +1 -0
  58. package/lib/api/index.js +4 -2
  59. package/lib/api/nem/nemSignTx.d.ts +1 -1
  60. package/lib/api/nemSignTransaction.js +1 -1
  61. package/lib/api/signTransaction.d.ts +2 -2
  62. package/lib/api/signTransaction.js +1 -1
  63. package/lib/api/stellar/stellarSignTx.d.ts +1 -1
  64. package/lib/api/stellarSignTransaction.d.ts +1 -1
  65. package/lib/api/stellarSignTransaction.js +1 -1
  66. package/lib/api/tezos/tezosSignTx.d.ts +1 -1
  67. package/lib/api/tezos/tezosSignTx.js +1 -1
  68. package/lib/api/tezosSignTransaction.js +1 -1
  69. package/lib/backend/BlockchainLink.js +1 -1
  70. package/lib/constants/errors.d.ts +1 -1
  71. package/lib/constants/errors.js +1 -1
  72. package/lib/constants/index.js +5 -5
  73. package/lib/core/AbstractMethod.js +1 -1
  74. package/lib/core/index.d.ts +1 -1
  75. package/lib/core/index.js +1 -1
  76. package/lib/core/method.d.ts +1 -1
  77. package/lib/core/method.js +1 -1
  78. package/lib/data/DataManager.js +1 -1
  79. package/lib/data/connectSettings.d.ts +1 -1
  80. package/lib/data/firmwareInfo.js +0 -9
  81. package/lib/data/version.d.ts +1 -1
  82. package/lib/data/version.js +1 -1
  83. package/lib/device/AbortController.js +1 -1
  84. package/lib/device/DescriptorStream.js +1 -1
  85. package/lib/device/Device.js +1 -1
  86. package/lib/device/DeviceCommands.js +2 -2
  87. package/lib/device/DeviceList.js +6 -4
  88. package/lib/events/index.js +10 -10
  89. package/lib/exports.js +3 -3
  90. package/lib/factory.js +1 -0
  91. package/lib/index-browser.js +1 -1
  92. package/lib/index.js +2 -2
  93. package/lib/types/api/binance/index.d.ts +29 -0
  94. package/lib/types/api/binance/index.js +3 -0
  95. package/lib/types/api/binanceSignTransaction.d.ts +1 -27
  96. package/lib/types/api/bitcoin/index.d.ts +82 -0
  97. package/lib/types/api/bitcoin/index.js +3 -0
  98. package/lib/types/api/cardano/index.d.ts +193 -0
  99. package/lib/types/api/cardano/index.js +3 -0
  100. package/lib/types/api/cardanoGetAddress.d.ts +1 -31
  101. package/lib/types/api/cardanoGetNativeScriptHash.d.ts +1 -18
  102. package/lib/types/api/cardanoGetPublicKey.d.ts +1 -12
  103. package/lib/types/api/cardanoSignTransaction.d.ts +1 -127
  104. package/lib/types/api/eos/index.d.ts +119 -0
  105. package/lib/types/api/eos/index.js +3 -0
  106. package/lib/types/api/eosGetPublicKey.d.ts +1 -10
  107. package/lib/types/api/eosSignTransaction.d.ts +1 -107
  108. package/lib/types/api/ethereum/index.d.ts +86 -0
  109. package/lib/types/api/ethereum/index.js +3 -0
  110. package/lib/types/api/ethereumSignMessage.d.ts +1 -5
  111. package/lib/types/api/ethereumSignTransaction.d.ts +1 -37
  112. package/lib/types/api/ethereumSignTypedData.d.ts +1 -37
  113. package/lib/types/api/ethereumVerifyMessage.d.ts +1 -6
  114. package/lib/types/api/firmwareUpdate.d.ts +6 -3
  115. package/lib/types/api/getFirmwareHash.d.ts +4 -0
  116. package/lib/types/api/getFirmwareHash.js +3 -0
  117. package/lib/types/api/index.d.ts +2 -0
  118. package/lib/types/api/nem/index.d.ts +90 -0
  119. package/lib/types/api/nem/index.js +3 -0
  120. package/lib/types/api/nemSignTransaction.d.ts +2 -89
  121. package/lib/types/api/ripple/index.d.ts +21 -0
  122. package/lib/types/api/ripple/index.js +3 -0
  123. package/lib/types/api/rippleSignTransaction.d.ts +1 -20
  124. package/lib/types/api/signMessage.d.ts +1 -7
  125. package/lib/types/api/signTransaction.d.ts +1 -67
  126. package/lib/types/api/stellar/index.d.ts +180 -0
  127. package/lib/types/api/stellar/index.js +3 -0
  128. package/lib/types/api/stellarSignTransaction.d.ts +1 -179
  129. package/lib/types/api/tezos/index.d.ts +58 -0
  130. package/lib/types/api/tezos/index.js +3 -0
  131. package/lib/types/api/tezosSignTransaction.d.ts +1 -57
  132. package/lib/types/api/verifyMessage.d.ts +1 -7
  133. package/lib/types/index.d.ts +8 -4
  134. package/lib/types/index.js +15 -7
  135. package/lib/utils/__fixtures__/accountUtils.js +1 -1
  136. package/lib/utils/__fixtures__/ethereumUtils.js +1 -1
  137. package/lib/utils/__fixtures__/formatUtils.js +1 -1
  138. package/lib/utils/accountUtils.d.ts +2 -2
  139. package/lib/utils/assetUtils.d.ts +2 -0
  140. package/lib/utils/assetUtils.js +22 -0
  141. package/lib/utils/assets-browser.js +1 -1
  142. package/lib/utils/assets-native.d.ts +2 -0
  143. package/lib/utils/assets-native.js +7 -0
  144. package/lib/utils/assets.js +6 -14
  145. package/lib/utils/browserUtils.js +1 -1
  146. package/lib/utils/debug.d.ts +2 -2
  147. package/lib/utils/deviceFeaturesUtils.d.ts +1 -1
  148. package/lib/utils/deviceFeaturesUtils.js +1 -1
  149. package/lib/utils/ethereumUtils.d.ts +1 -1
  150. package/lib/utils/formatUtils.js +1 -1
  151. package/lib/utils/hdnodeUtils.d.ts +1 -1
  152. package/lib/utils/pathUtils.d.ts +2 -2
  153. package/lib/workers/workers-browser.js +5 -5
  154. package/lib/workers/workers-react-native.js +4 -4
  155. package/lib/workers/workers.js +4 -4
  156. package/package.json +12 -9
  157. package/CHANGELOG.md +0 -26
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.signTx = exports.validate = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const bs58 = (0, tslib_1.__importStar)(require("bs58"));
5
+ const bs58 = tslib_1.__importStar(require("bs58"));
6
6
  const constants_1 = require("../../constants");
7
7
  const binaryToDecimal = (bignum, minDigits = 1) => {
8
8
  const result = Array(minDigits).fill('0'.charCodeAt(0));
@@ -5,6 +5,6 @@ export default class EosGetPublicKey extends AbstractMethod<'eosGetPublicKey', P
5
5
  confirmed?: boolean;
6
6
  init(): void;
7
7
  confirmation(): Promise<boolean>;
8
- run(): Promise<import("../types/api/eosGetPublicKey").EosPublicKey | import("../types/api/eosGetPublicKey").EosPublicKey[]>;
8
+ run(): Promise<import("..").EosPublicKey | import("..").EosPublicKey[]>;
9
9
  }
10
10
  //# sourceMappingURL=eosGetPublicKey.d.ts.map
@@ -5,7 +5,7 @@ const AbstractMethod_1 = require("../core/AbstractMethod");
5
5
  const paramsValidator_1 = require("./common/paramsValidator");
6
6
  const coinInfo_1 = require("../data/coinInfo");
7
7
  const pathUtils_1 = require("../utils/pathUtils");
8
- const helper = (0, tslib_1.__importStar)(require("./eos/eosSignTx"));
8
+ const helper = tslib_1.__importStar(require("./eos/eosSignTx"));
9
9
  class EosSignTransaction extends AbstractMethod_1.AbstractMethod {
10
10
  init() {
11
11
  this.requiredPermissions = ['read', 'write'];
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.encodeData = exports.getFieldType = exports.parseArrayType = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const bignumber_js_1 = (0, tslib_1.__importDefault)(require("bignumber.js"));
5
+ const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
6
6
  const errors_1 = require("../../../constants/errors");
7
7
  const constants_1 = require("../../../constants");
8
8
  exports.parseArrayType = [
@@ -1,11 +1,11 @@
1
1
  import type { TypedCall } from '../../device/DeviceCommands';
2
- import type { EthereumAccessList } from '../../types/api/ethereumSignTransaction';
3
- 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 | undefined, tx_type?: number | undefined) => Promise<{
2
+ import type { EthereumAccessList } from '../../types/api/ethereum';
3
+ 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) => Promise<{
4
4
  v: string;
5
5
  r: string;
6
6
  s: string;
7
7
  }>;
8
- 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 | undefined, access_list?: EthereumAccessList[] | undefined) => Promise<{
8
+ 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[]) => Promise<{
9
9
  v: string;
10
10
  r: string;
11
11
  s: string;
@@ -1,5 +1,5 @@
1
1
  import { PROTO } from '../../constants';
2
- import type { EthereumSignTypedDataTypes } from '../../types/api/ethereumSignTypedData';
2
+ import type { EthereumSignTypedDataTypes } from '../../types/api/ethereum';
3
3
  export declare function parseArrayType(arrayTypeName: string): {
4
4
  entryTypeName: string;
5
5
  arraySize: number | null;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getFieldType = exports.encodeData = exports.parseArrayType = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const bignumber_js_1 = (0, tslib_1.__importDefault)(require("bignumber.js"));
5
+ const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
6
6
  const constants_1 = require("../../constants");
7
7
  const formatUtils_1 = require("../../utils/formatUtils");
8
8
  const paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
@@ -1,5 +1,5 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { EthereumTransaction, EthereumTransactionEIP1559 } from '../types/api/ethereumSignTransaction';
2
+ import type { EthereumTransaction, EthereumTransactionEIP1559 } from '../types/api/ethereum';
3
3
  declare type Params = {
4
4
  path: number[];
5
5
  tx: ({
@@ -7,7 +7,7 @@ const pathUtils_1 = require("../utils/pathUtils");
7
7
  const coinInfo_1 = require("../data/coinInfo");
8
8
  const ethereumUtils_1 = require("../utils/ethereumUtils");
9
9
  const formatUtils_1 = require("../utils/formatUtils");
10
- const helper = (0, tslib_1.__importStar)(require("./ethereum/ethereumSignTx"));
10
+ const helper = tslib_1.__importStar(require("./ethereum/ethereumSignTx"));
11
11
  const strip = value => {
12
12
  if (typeof value === 'string') {
13
13
  let stripped = (0, formatUtils_1.stripHexPrefix)(value);
@@ -1,5 +1,5 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { EthereumSignTypedDataTypes, EthereumSignTypedData as EthereumSignTypedDataParams, EthereumSignTypedHash as EthereumSignTypedHashParams } from '../types/api/ethereumSignTypedData';
2
+ import type { EthereumSignTypedDataTypes, EthereumSignTypedData as EthereumSignTypedDataParams, EthereumSignTypedHash as EthereumSignTypedHashParams } from '../types/api/ethereum';
3
3
  declare type Params = (Omit<EthereumSignTypedDataParams<EthereumSignTypedDataTypes>, 'path'> | Omit<EthereumSignTypedHashParams<EthereumSignTypedDataTypes>, 'path'>) & {
4
4
  address_n: number[];
5
5
  };
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ export declare const calculateFirmwareHash: (major_version: number, fw: ArrayBuffer, key?: Buffer) => {
3
+ hash: string;
4
+ challenge: string;
5
+ };
6
+ //# sourceMappingURL=calculateFirmwareHash.d.ts.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateFirmwareHash = void 0;
4
+ const blakejs_1 = require("blakejs");
5
+ const SIZE_T1 = (7 * 128 + 64) * 1024;
6
+ const SIZE_TT = 13 * 128 * 1024;
7
+ const calculateFirmwareHash = (major_version, fw, key) => {
8
+ const size = major_version === 1 ? SIZE_T1 : SIZE_TT;
9
+ const padding = size - fw.byteLength;
10
+ if (padding < 0) {
11
+ throw new Error('Firmware too big');
12
+ }
13
+ const data = new Uint8Array(new ArrayBuffer(size));
14
+ data.set(new Uint8Array(fw));
15
+ if (padding > 0) {
16
+ const zeroBytes = Buffer.alloc(padding);
17
+ zeroBytes.fill(Buffer.from('ff', 'hex'));
18
+ data.set(zeroBytes, fw.byteLength);
19
+ }
20
+ return {
21
+ hash: key && key.length > 0 ? (0, blakejs_1.blake2sHex)(data, key) : (0, blakejs_1.blake2sHex)(data),
22
+ challenge: key ? key.toString('hex') : '',
23
+ };
24
+ };
25
+ exports.calculateFirmwareHash = calculateFirmwareHash;
26
+ //# sourceMappingURL=calculateFirmwareHash.js.map
@@ -6,9 +6,9 @@ interface GetBinaryProps extends GetInfoProps {
6
6
  intermediary?: boolean;
7
7
  }
8
8
  export declare const getBinary: ({ features, releases, baseUrl, version, btcOnly, intermediary, }: GetBinaryProps) => Promise<{
9
- binary: ArrayBuffer;
9
+ binary: any;
10
10
  } | {
11
- binary: ArrayBuffer;
11
+ binary: any;
12
12
  changelog: import("../..").FirmwareRelease[] | null;
13
13
  release: import("../..").FirmwareRelease;
14
14
  isLatest: boolean;
@@ -5,14 +5,13 @@ const utils_1 = require("@trezor/utils");
5
5
  const assets_1 = require("../../utils/assets");
6
6
  const firmwareUtils_1 = require("../../utils/firmwareUtils");
7
7
  const firmwareInfo_1 = require("../../data/firmwareInfo");
8
- const modifyFirmware_1 = require("./modifyFirmware");
9
8
  const getBinary = async ({ features, releases, baseUrl, version, btcOnly, intermediary = false, }) => {
10
9
  if (!(0, firmwareUtils_1.isStrictFeatures)(features)) {
11
10
  throw new Error('Features of unexpected shape provided');
12
11
  }
13
12
  if (intermediary && features.major_version !== 2) {
14
13
  const fw = await (0, assets_1.httpRequest)(`${baseUrl}/firmware/1/trezor-inter-1.10.0.bin`, 'binary');
15
- return { binary: (0, modifyFirmware_1.modifyFirmware)({ fw, features }) };
14
+ return { binary: fw };
16
15
  }
17
16
  const infoByBootloader = (0, firmwareInfo_1.getInfo)({ features, releases });
18
17
  const releaseByFirmware = releases.find(r => version &&
@@ -30,7 +29,7 @@ const getBinary = async ({ features, releases, baseUrl, version, btcOnly, interm
30
29
  const fw = await (0, assets_1.httpRequest)(`${baseUrl}/${btcOnly ? releaseByFirmware.url_bitcoinonly : releaseByFirmware.url}`, 'binary');
31
30
  return {
32
31
  ...infoByBootloader,
33
- binary: (0, modifyFirmware_1.modifyFirmware)({ fw, features }),
32
+ binary: fw,
34
33
  };
35
34
  };
36
35
  exports.getBinary = getBinary;
@@ -0,0 +1,5 @@
1
+ export { getBinary } from './getBinary';
2
+ export { shouldStripFwHeaders, stripFwHeaders } from './modifyFirmware';
3
+ export { uploadFirmware } from './uploadFirmware';
4
+ export { calculateFirmwareHash } from './calculateFirmwareHash';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateFirmwareHash = exports.uploadFirmware = exports.stripFwHeaders = exports.shouldStripFwHeaders = exports.getBinary = void 0;
4
+ var getBinary_1 = require("./getBinary");
5
+ Object.defineProperty(exports, "getBinary", { enumerable: true, get: function () { return getBinary_1.getBinary; } });
6
+ var modifyFirmware_1 = require("./modifyFirmware");
7
+ Object.defineProperty(exports, "shouldStripFwHeaders", { enumerable: true, get: function () { return modifyFirmware_1.shouldStripFwHeaders; } });
8
+ Object.defineProperty(exports, "stripFwHeaders", { enumerable: true, get: function () { return modifyFirmware_1.stripFwHeaders; } });
9
+ var uploadFirmware_1 = require("./uploadFirmware");
10
+ Object.defineProperty(exports, "uploadFirmware", { enumerable: true, get: function () { return uploadFirmware_1.uploadFirmware; } });
11
+ var calculateFirmwareHash_1 = require("./calculateFirmwareHash");
12
+ Object.defineProperty(exports, "calculateFirmwareHash", { enumerable: true, get: function () { return calculateFirmwareHash_1.calculateFirmwareHash; } });
13
+ //# sourceMappingURL=index.js.map
@@ -1,6 +1,4 @@
1
- import type { StrictFeatures } from '../../types';
2
- export declare const modifyFirmware: ({ fw, features }: {
3
- fw: ArrayBuffer;
4
- features: StrictFeatures;
5
- }) => ArrayBuffer;
1
+ import type { Features } from '../../types';
2
+ export declare const shouldStripFwHeaders: (features: Features) => boolean;
3
+ export declare const stripFwHeaders: (fw: ArrayBuffer) => ArrayBuffer;
6
4
  //# sourceMappingURL=modifyFirmware.d.ts.map
@@ -1,18 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.modifyFirmware = void 0;
3
+ exports.stripFwHeaders = exports.shouldStripFwHeaders = void 0;
4
4
  const utils_1 = require("@trezor/utils");
5
- const modifyFirmware = ({ fw, features }) => {
5
+ const shouldStripFwHeaders = (features) => {
6
6
  if (features.major_version === 2)
7
- return fw;
8
- if (utils_1.versionUtils.isNewerOrEqual([features.major_version, features.minor_version, features.patch_version], [1, 8, 0])) {
9
- const fwView = new Uint8Array(fw);
10
- if (String.fromCharCode(...Array.from(fwView.slice(0, 4))) === 'TRZR' &&
11
- String.fromCharCode(...Array.from(fwView.slice(256, 260))) === 'TRZF') {
12
- return fw.slice(256);
13
- }
7
+ return false;
8
+ return utils_1.versionUtils.isNewerOrEqual([features.major_version, features.minor_version, features.patch_version], [1, 8, 0]);
9
+ };
10
+ exports.shouldStripFwHeaders = shouldStripFwHeaders;
11
+ const stripFwHeaders = (fw) => {
12
+ const fwView = new Uint8Array(fw);
13
+ if (String.fromCharCode(...Array.from(fwView.slice(0, 4))) === 'TRZR' &&
14
+ String.fromCharCode(...Array.from(fwView.slice(256, 260))) === 'TRZF') {
15
+ return fw.slice(256);
14
16
  }
15
17
  return fw;
16
18
  };
17
- exports.modifyFirmware = modifyFirmware;
19
+ exports.stripFwHeaders = stripFwHeaders;
18
20
  //# sourceMappingURL=modifyFirmware.js.map
@@ -9,7 +9,10 @@ declare type Params = {
9
9
  export default class FirmwareUpdate extends AbstractMethod<'firmwareUpdate', Params> {
10
10
  init(): void;
11
11
  confirmation(): Promise<boolean>;
12
- run(): Promise<import("packages/transport/lib/types/messages").Success>;
12
+ run(): Promise<{
13
+ hash: string;
14
+ challenge: string;
15
+ }>;
13
16
  }
14
17
  export {};
15
18
  //# sourceMappingURL=firmwareUpdate.d.ts.map
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const getBinary_1 = require("./firmware/getBinary");
4
- const modifyFirmware_1 = require("./firmware/modifyFirmware");
3
+ const tslib_1 = require("tslib");
4
+ const randombytes_1 = tslib_1.__importDefault(require("randombytes"));
5
5
  const AbstractMethod_1 = require("../core/AbstractMethod");
6
6
  const constants_1 = require("../constants");
7
7
  const events_1 = require("../events");
8
- const uploadFirmware_1 = require("./management/uploadFirmware");
8
+ const firmware_1 = require("./firmware");
9
9
  const paramsValidator_1 = require("./common/paramsValidator");
10
10
  const firmwareInfo_1 = require("../data/firmwareInfo");
11
- const firmwareUtils_1 = require("../utils/firmwareUtils");
12
11
  class FirmwareUpdate extends AbstractMethod_1.AbstractMethod {
13
12
  init() {
14
13
  this.useEmptyPassphrase = true;
@@ -59,16 +58,10 @@ class FirmwareUpdate extends AbstractMethod_1.AbstractMethod {
59
58
  let binary;
60
59
  try {
61
60
  if (params.binary) {
62
- if (!(0, firmwareUtils_1.isStrictFeatures)(device.features)) {
63
- throw new Error('Features of unexpected shape provided');
64
- }
65
- binary = (0, modifyFirmware_1.modifyFirmware)({
66
- fw: params.binary,
67
- features: device.features,
68
- });
61
+ binary = params.binary;
69
62
  }
70
63
  else {
71
- const firmware = await (0, getBinary_1.getBinary)({
64
+ const firmware = await (0, firmware_1.getBinary)({
72
65
  features: device.features,
73
66
  releases: (0, firmwareInfo_1.getReleases)(device.features.major_version),
74
67
  version: params.version,
@@ -82,7 +75,9 @@ class FirmwareUpdate extends AbstractMethod_1.AbstractMethod {
82
75
  catch (err) {
83
76
  throw constants_1.ERRORS.TypedError('Method_FirmwareUpdate_DownloadFailed', 'Failed to download firmware binary');
84
77
  }
85
- return (0, uploadFirmware_1.uploadFirmware)(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, { payload: binary });
78
+ const stripped = (0, firmware_1.stripFwHeaders)(binary);
79
+ await (0, firmware_1.uploadFirmware)(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, { payload: (0, firmware_1.shouldStripFwHeaders)(device.features) ? stripped : binary });
80
+ return (0, firmware_1.calculateFirmwareHash)(device.features.major_version, stripped, (0, randombytes_1.default)(32));
86
81
  }
87
82
  }
88
83
  exports.default = FirmwareUpdate;
@@ -0,0 +1,7 @@
1
+ import { AbstractMethod } from '../core/AbstractMethod';
2
+ import { PROTO } from '../constants';
3
+ export default class GetFirmwareHash extends AbstractMethod<'getFirmwareHash', PROTO.GetFirmwareHash> {
4
+ init(): void;
5
+ run(): Promise<PROTO.FirmwareHash>;
6
+ }
7
+ //# sourceMappingURL=getFirmwareHash.d.ts.map
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const AbstractMethod_1 = require("../core/AbstractMethod");
4
+ const events_1 = require("../events");
5
+ const paramsValidator_1 = require("./common/paramsValidator");
6
+ class GetFirmwareHash extends AbstractMethod_1.AbstractMethod {
7
+ init() {
8
+ this.requiredPermissions = ['management'];
9
+ this.useEmptyPassphrase = true;
10
+ this.useDeviceState = false;
11
+ this.allowDeviceMode = [events_1.UI.INITIALIZE];
12
+ const { payload } = this;
13
+ (0, paramsValidator_1.validateParams)(payload, [{ name: 'challenge', type: 'string' }]);
14
+ this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, {
15
+ 1: { min: '1.11.1', max: '0' },
16
+ 2: { min: '2.5.1', max: '0' },
17
+ });
18
+ this.params = {
19
+ challenge: payload.challenge,
20
+ };
21
+ }
22
+ async run() {
23
+ const cmd = this.device.getCommands();
24
+ const response = await cmd.typedCall('GetFirmwareHash', 'FirmwareHash', this.params);
25
+ return response.message;
26
+ }
27
+ }
28
+ exports.default = GetFirmwareHash;
29
+ //# sourceMappingURL=getFirmwareHash.js.map
@@ -38,6 +38,7 @@ export { default as getAddress } from './getAddress';
38
38
  export { default as getCoinInfo } from './getCoinInfo';
39
39
  export { default as getDeviceState } from './getDeviceState';
40
40
  export { default as getFeatures } from './getFeatures';
41
+ export { default as getFirmwareHash } from './getFirmwareHash';
41
42
  export { default as getOwnershipId } from './getOwnershipId';
42
43
  export { default as getOwnershipProof } from './getOwnershipProof';
43
44
  export { default as getPublicKey } from './getPublicKey';
package/lib/api/index.js CHANGED
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.nemSignTransaction = exports.nemGetAddress = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.firmwareUpdate = exports.ethereumVerifyMessage = exports.ethereumSignTypedData = exports.ethereumSignTransaction = exports.ethereumSignMessage = exports.ethereumGetPublicKey = exports.ethereumGetAddress = exports.eosSignTransaction = exports.eosGetPublicKey = exports.customMessage = exports.composeTransaction = exports.cipherKeyValue = exports.changePin = exports.cardanoSignTransaction = exports.cardanoGetPublicKey = exports.cardanoGetNativeScriptHash = exports.cardanoGetAddress = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.binanceSignTransaction = exports.binanceGetPublicKey = exports.binanceGetAddress = exports.backupDevice = exports.authorizeCoinJoin = exports.applySettings = exports.applyFlags = void 0;
7
- exports.wipeDevice = exports.verifyMessage = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.rippleSignTransaction = exports.rippleGetAddress = exports.resetDevice = void 0;
6
+ exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.nemSignTransaction = exports.nemGetAddress = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.firmwareUpdate = exports.ethereumVerifyMessage = exports.ethereumSignTypedData = exports.ethereumSignTransaction = exports.ethereumSignMessage = exports.ethereumGetPublicKey = exports.ethereumGetAddress = exports.eosSignTransaction = exports.eosGetPublicKey = exports.customMessage = exports.composeTransaction = exports.cipherKeyValue = exports.changePin = exports.cardanoSignTransaction = exports.cardanoGetPublicKey = exports.cardanoGetNativeScriptHash = exports.cardanoGetAddress = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.binanceSignTransaction = exports.binanceGetPublicKey = exports.binanceGetAddress = exports.backupDevice = exports.authorizeCoinJoin = exports.applySettings = exports.applyFlags = void 0;
7
+ exports.wipeDevice = exports.verifyMessage = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.rippleSignTransaction = exports.rippleGetAddress = exports.resetDevice = exports.requestLogin = void 0;
8
8
  var applyFlags_1 = require("./applyFlags");
9
9
  Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return __importDefault(applyFlags_1).default; } });
10
10
  var applySettings_1 = require("./applySettings");
@@ -85,6 +85,8 @@ var getDeviceState_1 = require("./getDeviceState");
85
85
  Object.defineProperty(exports, "getDeviceState", { enumerable: true, get: function () { return __importDefault(getDeviceState_1).default; } });
86
86
  var getFeatures_1 = require("./getFeatures");
87
87
  Object.defineProperty(exports, "getFeatures", { enumerable: true, get: function () { return __importDefault(getFeatures_1).default; } });
88
+ var getFirmwareHash_1 = require("./getFirmwareHash");
89
+ Object.defineProperty(exports, "getFirmwareHash", { enumerable: true, get: function () { return __importDefault(getFirmwareHash_1).default; } });
88
90
  var getOwnershipId_1 = require("./getOwnershipId");
89
91
  Object.defineProperty(exports, "getOwnershipId", { enumerable: true, get: function () { return __importDefault(getOwnershipId_1).default; } });
90
92
  var getOwnershipProof_1 = require("./getOwnershipProof");
@@ -1,4 +1,4 @@
1
1
  import { PROTO } from '../../constants';
2
- import * as $T from '../../types/api/nemSignTransaction';
2
+ import * as $T from '../../types/api/nem';
3
3
  export declare const createTx: (tx: $T.NEMTransaction, address_n: number[]) => PROTO.NEMSignTx;
4
4
  //# sourceMappingURL=nemSignTx.d.ts.map
@@ -5,7 +5,7 @@ const AbstractMethod_1 = require("../core/AbstractMethod");
5
5
  const paramsValidator_1 = require("./common/paramsValidator");
6
6
  const coinInfo_1 = require("../data/coinInfo");
7
7
  const pathUtils_1 = require("../utils/pathUtils");
8
- const helper = (0, tslib_1.__importStar)(require("./nem/nemSignTx"));
8
+ const helper = tslib_1.__importStar(require("./nem/nemSignTx"));
9
9
  class NEMSignTransaction extends AbstractMethod_1.AbstractMethod {
10
10
  init() {
11
11
  this.requiredPermissions = ['read', 'write'];
@@ -1,7 +1,7 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
3
  import type { BitcoinNetworkInfo, AccountAddresses } from '../types';
4
- import type { RefTransaction, TransactionOptions } from '../types/api/signTransaction';
4
+ import type { RefTransaction, TransactionOptions } from '../types/api/bitcoin';
5
5
  declare type Params = {
6
6
  inputs: PROTO.TxInputType[];
7
7
  outputs: PROTO.TxOutputType[];
@@ -15,7 +15,7 @@ declare type Params = {
15
15
  };
16
16
  export default class SignTransaction extends AbstractMethod<'signTransaction', Params> {
17
17
  init(): void;
18
- run(): Promise<import("../types/api/signTransaction").SignedTransaction>;
18
+ run(): Promise<import("../types").SignedTransaction>;
19
19
  }
20
20
  export {};
21
21
  //# sourceMappingURL=signTransaction.d.ts.map
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const bignumber_js_1 = (0, tslib_1.__importDefault)(require("bignumber.js"));
4
+ const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
5
5
  const AbstractMethod_1 = require("../core/AbstractMethod");
6
6
  const paramsValidator_1 = require("./common/paramsValidator");
7
7
  const coinInfo_1 = require("../data/coinInfo");
@@ -1,5 +1,5 @@
1
1
  import { PROTO } from '../../constants';
2
2
  import type { TypedCall } from '../../device/DeviceCommands';
3
- import type { StellarTransaction } from '../../types/api/stellarSignTransaction';
3
+ import type { StellarTransaction } from '../../types/api/stellar';
4
4
  export declare const stellarSignTx: (typedCall: TypedCall, address_n: number[], networkPassphrase: string, tx: StellarTransaction) => Promise<PROTO.StellarSignedTx>;
5
5
  //# sourceMappingURL=stellarSignTx.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
- import { StellarTransaction } from '../types/api/stellarSignTransaction';
2
+ import { StellarTransaction } from '../types/api/stellar';
3
3
  declare type Params = {
4
4
  path: number[];
5
5
  networkPassphrase: string;
@@ -5,7 +5,7 @@ const AbstractMethod_1 = require("../core/AbstractMethod");
5
5
  const paramsValidator_1 = require("./common/paramsValidator");
6
6
  const coinInfo_1 = require("../data/coinInfo");
7
7
  const pathUtils_1 = require("../utils/pathUtils");
8
- const helper = (0, tslib_1.__importStar)(require("./stellar/stellarSignTx"));
8
+ const helper = tslib_1.__importStar(require("./stellar/stellarSignTx"));
9
9
  const constants_1 = require("../constants");
10
10
  const StellarSignTransactionFeatures = Object.freeze({
11
11
  manageBuyOffer: ['1.10.4', '2.4.3'],
@@ -1,4 +1,4 @@
1
1
  import { PROTO } from '../../constants';
2
- import type { TezosOperation } from '../../types/api/tezosSignTransaction';
2
+ import type { TezosOperation } from '../../types/api/tezos';
3
3
  export declare const createTx: (address_n: number[], branch: string, operation: TezosOperation) => PROTO.TezosSignTx;
4
4
  //# sourceMappingURL=tezosSignTx.d.ts.map
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTx = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const bs58check = (0, tslib_1.__importStar)(require("bs58check"));
5
+ const bs58check = tslib_1.__importStar(require("bs58check"));
6
6
  const constants_1 = require("../../constants");
7
7
  const paramsValidator_1 = require("../common/paramsValidator");
8
8
  const PREFIX = {
@@ -5,7 +5,7 @@ const AbstractMethod_1 = require("../core/AbstractMethod");
5
5
  const paramsValidator_1 = require("./common/paramsValidator");
6
6
  const coinInfo_1 = require("../data/coinInfo");
7
7
  const pathUtils_1 = require("../utils/pathUtils");
8
- const helper = (0, tslib_1.__importStar)(require("./tezos/tezosSignTx"));
8
+ const helper = tslib_1.__importStar(require("./tezos/tezosSignTx"));
9
9
  class TezosSignTransaction extends AbstractMethod_1.AbstractMethod {
10
10
  init() {
11
11
  this.requiredPermissions = ['read', 'write'];
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dispose = exports.reconnectAllBackends = exports.initBlockchain = exports.isBackendSupported = exports.setCustomBackend = exports.findBackend = exports.Blockchain = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const blockchain_link_1 = (0, tslib_1.__importDefault)(require("@trezor/blockchain-link"));
5
+ const blockchain_link_1 = tslib_1.__importDefault(require("@trezor/blockchain-link"));
6
6
  const config_1 = require("../data/config");
7
7
  const DataManager_1 = require("../data/DataManager");
8
8
  const events_1 = require("../events");
@@ -40,7 +40,7 @@ export declare class TrezorError extends Error {
40
40
  message: string;
41
41
  constructor(code: string, message: string);
42
42
  }
43
- export declare const TypedError: (id: keyof typeof ERROR_CODES, message?: string | undefined) => TrezorError;
43
+ export declare const TypedError: (id: keyof typeof ERROR_CODES, message?: string) => TrezorError;
44
44
  export declare const serializeError: (payload: any) => any;
45
45
  export declare const WRONG_PREVIOUS_SESSION_ERROR_MESSAGE = "wrong previous session";
46
46
  export declare const INVALID_PIN_ERROR_MESSAGE = "PIN invalid";
@@ -6,7 +6,7 @@ exports.ERROR_CODES = {
6
6
  Init_AlreadyInitialized: 'TrezorConnect has been already initialized',
7
7
  Init_IframeBlocked: 'Iframe blocked',
8
8
  Init_IframeTimeout: 'Iframe timeout',
9
- Init_ManifestMissing: 'Manifest not set. Read more at https://github.com/trezor/connect/blob/develop/docs/index.md',
9
+ Init_ManifestMissing: 'Manifest not set. Read more at https://github.com/trezor/trezor-suite/blob/develop/docs/packages/connect/index.md',
10
10
  Popup_ConnectionMissing: 'Unable to establish connection with iframe',
11
11
  Transport_Missing: 'Transport is missing',
12
12
  Transport_InvalidProtobuf: '',
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROTO = exports.NEM = exports.CARDANO = exports.NETWORK = exports.ERRORS = void 0;
4
4
  const tslib_1 = require("tslib");
5
- exports.ERRORS = (0, tslib_1.__importStar)(require("./errors"));
6
- exports.NETWORK = (0, tslib_1.__importStar)(require("./network"));
7
- exports.CARDANO = (0, tslib_1.__importStar)(require("./cardano"));
8
- exports.NEM = (0, tslib_1.__importStar)(require("./nem"));
9
- exports.PROTO = (0, tslib_1.__importStar)(require("@trezor/transport/lib/types/messages"));
5
+ exports.ERRORS = tslib_1.__importStar(require("./errors"));
6
+ exports.NETWORK = tslib_1.__importStar(require("./network"));
7
+ exports.CARDANO = tslib_1.__importStar(require("./cardano"));
8
+ exports.NEM = tslib_1.__importStar(require("./nem"));
9
+ exports.PROTO = tslib_1.__importStar(require("@trezor/transport/lib/types/messages"));
10
10
  //# sourceMappingURL=index.js.map
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AbstractMethod = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const storage = (0, tslib_1.__importStar)(require("@trezor/connect-common/lib/storage"));
5
+ const storage = tslib_1.__importStar(require("@trezor/connect-common/lib/storage"));
6
6
  const DataManager_1 = require("../data/DataManager");
7
7
  const constants_1 = require("../constants");
8
8
  const events_1 = require("../events");
@@ -7,7 +7,7 @@ export declare const onCall: (message: CoreMessage) => Promise<void>;
7
7
  export declare class Core extends EventEmitter {
8
8
  handleMessage(message: any, isTrustedOrigin: boolean): void;
9
9
  dispose(): void;
10
- getCurrentMethod(): (import("../api").applyFlags | import("../api").applySettings | import("../api").authorizeCoinJoin | import("../api").backupDevice | import("../api").binanceGetAddress | import("../api").binanceGetPublicKey | import("../api").binanceSignTransaction | import("../api").blockchainDisconnect | import("../api").blockchainEstimateFee | import("../api").blockchainGetAccountBalanceHistory | import("../api").blockchainGetCurrentFiatRates | import("../api").blockchainGetFiatRatesForTimestamps | import("../api").blockchainGetTransactions | import("../api").blockchainSetCustomBackend | import("../api").blockchainSubscribe | import("../api").blockchainSubscribeFiatRates | import("../api").blockchainUnsubscribe | import("../api").blockchainUnsubscribeFiatRates | import("../api").cardanoGetAddress | import("../api").cardanoGetNativeScriptHash | import("../api").cardanoGetPublicKey | import("../api").cardanoSignTransaction | import("../api").changePin | import("../api").cipherKeyValue | import("../api").composeTransaction | import("../api").customMessage | import("../api").eosGetPublicKey | import("../api").eosSignTransaction | import("../api").ethereumGetAddress | import("../api").ethereumGetPublicKey | import("../api").ethereumSignMessage | import("../api").ethereumSignTransaction | import("../api").ethereumSignTypedData | import("../api").ethereumVerifyMessage | import("../api").firmwareUpdate | import("../api").getAccountInfo | import("../api").getAddress | import("../api").getCoinInfo | import("../api").getDeviceState | import("../api").getFeatures | import("../api").getOwnershipId | import("../api").getOwnershipProof | import("../api").getPublicKey | import("../api").getSettings | import("../api").nemGetAddress | import("../api").nemSignTransaction | import("../api").pushTransaction | import("../api").rebootToBootloader | import("../api").recoveryDevice | import("../api").requestLogin | import("../api").resetDevice | import("../api").rippleGetAddress | import("../api").rippleSignTransaction | import("../api").setProxy | import("../api").signMessage | import("../api").signTransaction | import("../api").stellarGetAddress | import("../api").stellarSignTransaction | import("../api").tezosGetAddress | import("../api").tezosGetPublicKey | import("../api").tezosSignTransaction | import("../api").verifyMessage | import("../api").wipeDevice)[];
10
+ getCurrentMethod(): (import("../api").applyFlags | import("../api").applySettings | import("../api").authorizeCoinJoin | import("../api").backupDevice | import("../api").binanceGetAddress | import("../api").binanceGetPublicKey | import("../api").binanceSignTransaction | import("../api").blockchainDisconnect | import("../api").blockchainEstimateFee | import("../api").blockchainGetAccountBalanceHistory | import("../api").blockchainGetCurrentFiatRates | import("../api").blockchainGetFiatRatesForTimestamps | import("../api").blockchainGetTransactions | import("../api").blockchainSetCustomBackend | import("../api").blockchainSubscribe | import("../api").blockchainSubscribeFiatRates | import("../api").blockchainUnsubscribe | import("../api").blockchainUnsubscribeFiatRates | import("../api").cardanoGetAddress | import("../api").cardanoGetNativeScriptHash | import("../api").cardanoGetPublicKey | import("../api").cardanoSignTransaction | import("../api").changePin | import("../api").cipherKeyValue | import("../api").composeTransaction | import("../api").customMessage | import("../api").eosGetPublicKey | import("../api").eosSignTransaction | import("../api").ethereumGetAddress | import("../api").ethereumGetPublicKey | import("../api").ethereumSignMessage | import("../api").ethereumSignTransaction | import("../api").ethereumSignTypedData | import("../api").ethereumVerifyMessage | import("../api").firmwareUpdate | import("../api").getAccountInfo | import("../api").getAddress | import("../api").getCoinInfo | import("../api").getDeviceState | import("../api").getFeatures | import("../api").getFirmwareHash | import("../api").getOwnershipId | import("../api").getOwnershipProof | import("../api").getPublicKey | import("../api").getSettings | import("../api").nemGetAddress | import("../api").nemSignTransaction | import("../api").pushTransaction | import("../api").rebootToBootloader | import("../api").recoveryDevice | import("../api").requestLogin | import("../api").resetDevice | import("../api").rippleGetAddress | import("../api").rippleSignTransaction | import("../api").setProxy | import("../api").signMessage | import("../api").signTransaction | import("../api").stellarGetAddress | import("../api").stellarSignTransaction | import("../api").tezosGetAddress | import("../api").tezosGetPublicKey | import("../api").tezosSignTransaction | import("../api").verifyMessage | import("../api").wipeDevice)[];
11
11
  getTransportInfo(): TransportInfo;
12
12
  }
13
13
  export declare const initCore: () => Core;
package/lib/core/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initTransport = exports.init = exports.initCore = exports.Core = exports.onCall = exports.handleMessage = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const events_1 = (0, tslib_1.__importDefault)(require("events"));
5
+ const events_1 = tslib_1.__importDefault(require("events"));
6
6
  const DataManager_1 = require("../data/DataManager");
7
7
  const DeviceList_1 = require("../device/DeviceList");
8
8
  const constants_1 = require("../constants");
@@ -2,5 +2,5 @@ import * as Methods from '../api';
2
2
  import type { IFrameCallMessage } from '../events';
3
3
  export declare const getMethod: (message: IFrameCallMessage & {
4
4
  id?: number;
5
- }) => Methods.applyFlags | Methods.applySettings | Methods.authorizeCoinJoin | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.customMessage | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.verifyMessage | Methods.wipeDevice;
5
+ }) => Methods.applyFlags | Methods.applySettings | Methods.authorizeCoinJoin | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.customMessage | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getFirmwareHash | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.verifyMessage | Methods.wipeDevice;
6
6
  //# sourceMappingURL=method.d.ts.map
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getMethod = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const Methods = (0, tslib_1.__importStar)(require("../api"));
5
+ const Methods = tslib_1.__importStar(require("../api"));
6
6
  const errors_1 = require("../constants/errors");
7
7
  const getMethod = (message) => {
8
8
  const { method } = message.payload;