@trezor/connect 9.4.2 → 9.4.3-beta.2

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 (214) hide show
  1. package/CHANGELOG.md +90 -9
  2. package/README.md +1 -1
  3. package/lib/api/applyFlags.js +1 -1
  4. package/lib/api/applySettings.js +1 -1
  5. package/lib/api/authenticateDevice.js +1 -1
  6. package/lib/api/authorizeCoinjoin.js +1 -1
  7. package/lib/api/backupDevice.js +1 -1
  8. package/lib/api/binance/api/binanceGetAddress.js +2 -1
  9. package/lib/api/binance/api/binanceGetPublicKey.js +2 -1
  10. package/lib/api/binance/api/binanceSignTransaction.js +2 -1
  11. package/lib/api/binance/binanceSignTx.js +1 -1
  12. package/lib/api/bitcoin/Fees.js +2 -2
  13. package/lib/api/bitcoin/TransactionComposer.d.ts +3 -3
  14. package/lib/api/bitcoin/TransactionComposer.js +2 -2
  15. package/lib/api/bitcoin/refTx.js +1 -1
  16. package/lib/api/blockchainDisconnect.js +1 -1
  17. package/lib/api/blockchainEvmRpcCall.d.ts +16 -0
  18. package/lib/api/blockchainEvmRpcCall.js +45 -0
  19. package/lib/api/cancelCoinjoinAuthorization.js +1 -1
  20. package/lib/api/cardano/api/cardanoGetAddress.js +2 -1
  21. package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +2 -1
  22. package/lib/api/cardano/api/cardanoGetPublicKey.js +2 -1
  23. package/lib/api/cardano/api/cardanoSignTransaction.js +2 -1
  24. package/lib/api/cardano/cardanoAddressParameters.js +1 -1
  25. package/lib/api/cardano/cardanoAuxiliaryData.js +1 -1
  26. package/lib/api/cardano/cardanoCertificate.js +1 -1
  27. package/lib/api/cardano/cardanoInputs.d.ts +8 -8
  28. package/lib/api/cardano/cardanoInputs.js +1 -1
  29. package/lib/api/cardano/cardanoOutputs.d.ts +22 -22
  30. package/lib/api/cardano/cardanoOutputs.js +1 -1
  31. package/lib/api/cardano/cardanoTokenBundle.d.ts +6 -6
  32. package/lib/api/cardano/cardanoTokenBundle.js +1 -1
  33. package/lib/api/changeLanguage.js +1 -1
  34. package/lib/api/changePin.js +1 -1
  35. package/lib/api/cipherKeyValue.js +1 -1
  36. package/lib/api/common/paramsValidator.js +1 -1
  37. package/lib/api/composeTransaction.d.ts +9 -3
  38. package/lib/api/composeTransaction.js +7 -4
  39. package/lib/api/eos/api/eosGetPublicKey.js +2 -1
  40. package/lib/api/eos/api/eosSignTransaction.js +2 -1
  41. package/lib/api/eos/eosSignTx.d.ts +3 -3
  42. package/lib/api/ethereum/api/ethereumGetAddress.js +2 -1
  43. package/lib/api/ethereum/api/ethereumGetPublicKey.js +2 -1
  44. package/lib/api/ethereum/api/ethereumSignMessage.d.ts +1 -1
  45. package/lib/api/ethereum/api/ethereumSignMessage.js +2 -1
  46. package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +1 -1
  47. package/lib/api/ethereum/api/ethereumSignTransaction.js +13 -7
  48. package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +58 -57
  49. package/lib/api/ethereum/api/ethereumSignTypedData.js +3 -2
  50. package/lib/api/ethereum/api/ethereumVerifyMessage.js +2 -1
  51. package/lib/api/ethereum/ethereumDefinitions.d.ts +21 -21
  52. package/lib/api/ethereum/ethereumDefinitions.js +6 -5
  53. package/lib/api/firmware/getBinary.d.ts +4 -5
  54. package/lib/api/firmware/getBinary.js +12 -13
  55. package/lib/api/firmware/getBinaryForFirmwareUpgrade.d.ts +3 -3
  56. package/lib/api/firmware/getBinaryForFirmwareUpgrade.js +2 -2
  57. package/lib/api/firmware/index.d.ts +1 -1
  58. package/lib/api/firmware/index.js +2 -1
  59. package/lib/api/firmware/x509certificate.js +3 -5
  60. package/lib/api/getAccountDescriptor.js +1 -1
  61. package/lib/api/getAddress.js +1 -1
  62. package/lib/api/getCoinInfo.d.ts +3 -0
  63. package/lib/api/getCoinInfo.js +1 -1
  64. package/lib/api/getFirmwareHash.js +1 -1
  65. package/lib/api/getOwnershipId.js +1 -1
  66. package/lib/api/getOwnershipProof.js +1 -1
  67. package/lib/api/getPublicKey.js +1 -1
  68. package/lib/api/index.d.ts +2 -1
  69. package/lib/api/index.js +5 -3
  70. package/lib/api/loadDevice.d.ts +14 -0
  71. package/lib/api/loadDevice.js +44 -0
  72. package/lib/api/nem/api/nemGetAddress.js +2 -1
  73. package/lib/api/nem/api/nemSignTransaction.js +2 -1
  74. package/lib/api/pushTransaction.js +1 -1
  75. package/lib/api/rebootToBootloader.js +1 -1
  76. package/lib/api/recoveryDevice.js +1 -1
  77. package/lib/api/requestLogin.js +1 -1
  78. package/lib/api/resetDevice.js +1 -2
  79. package/lib/api/ripple/api/rippleGetAddress.js +2 -1
  80. package/lib/api/ripple/api/rippleSignTransaction.js +2 -1
  81. package/lib/api/setBrightness.js +1 -1
  82. package/lib/api/setBusy.js +1 -1
  83. package/lib/api/signMessage.js +1 -1
  84. package/lib/api/solana/api/solanaGetAddress.js +2 -1
  85. package/lib/api/solana/api/solanaGetPublicKey.js +2 -1
  86. package/lib/api/solana/api/solanaSignTransaction.js +2 -1
  87. package/lib/api/stellar/api/stellarGetAddress.js +2 -1
  88. package/lib/api/stellar/api/stellarSignTransaction.js +2 -1
  89. package/lib/api/stellar/stellarSignTx.js +1 -1
  90. package/lib/api/tezos/api/tezosGetAddress.js +2 -1
  91. package/lib/api/tezos/api/tezosGetPublicKey.js +2 -1
  92. package/lib/api/tezos/api/tezosSignTransaction.js +2 -1
  93. package/lib/api/tezos/tezosSignTx.js +1 -1
  94. package/lib/api/unlockPath.js +1 -1
  95. package/lib/api/verifyMessage.js +1 -1
  96. package/lib/backend/Blockchain.d.ts +3 -0
  97. package/lib/backend/Blockchain.js +6 -6
  98. package/lib/constants/errors.d.ts +49 -38
  99. package/lib/constants/errors.js +10 -0
  100. package/lib/constants/firmware.d.ts +2 -0
  101. package/lib/constants/firmware.js +5 -0
  102. package/lib/constants/index.d.ts +2 -0
  103. package/lib/constants/index.js +4 -1
  104. package/lib/constants/nem.d.ts +3 -3
  105. package/lib/constants/utxo.d.ts +3 -0
  106. package/lib/constants/utxo.js +5 -0
  107. package/lib/core/AbstractMethod.d.ts +13 -5
  108. package/lib/core/AbstractMethod.js +50 -24
  109. package/lib/core/index.js +41 -30
  110. package/lib/core/onCallFirmwareUpdate.d.ts +2 -2
  111. package/lib/core/onCallFirmwareUpdate.js +6 -6
  112. package/lib/data/DataManager.d.ts +0 -181
  113. package/lib/data/DataManager.js +40 -6
  114. package/lib/data/analyticsInfo.js +4 -2
  115. package/lib/data/coinInfo.d.ts +14 -0
  116. package/lib/data/config.d.ts +20 -22
  117. package/lib/data/config.js +15 -40
  118. package/lib/data/connectSettings.js +10 -4
  119. package/lib/data/deviceAuthenticityConfig.js +20 -0
  120. package/lib/data/deviceAuthenticityConfigTypes.d.ts +32 -23
  121. package/lib/data/firmwareInfo.d.ts +1 -1
  122. package/lib/data/models.d.ts +9 -0
  123. package/lib/data/models.js +9 -0
  124. package/lib/data/version.d.ts +2 -1
  125. package/lib/data/version.js +3 -2
  126. package/lib/device/Device.d.ts +144 -36
  127. package/lib/device/Device.js +270 -113
  128. package/lib/device/DeviceCommands.js +4 -4
  129. package/lib/device/DeviceList.d.ts +13 -21
  130. package/lib/device/DeviceList.js +54 -168
  131. package/lib/device/checkFirmwareRevision.js +4 -4
  132. package/lib/device/prompts.js +3 -2
  133. package/lib/device/resolveDescriptorForTaproot.d.ts +1 -1
  134. package/lib/events/call.d.ts +5 -5
  135. package/lib/events/call.js +2 -2
  136. package/lib/events/core.d.ts +4 -3
  137. package/lib/events/device.d.ts +0 -6
  138. package/lib/events/device.js +0 -6
  139. package/lib/events/transport.d.ts +1 -1
  140. package/lib/factory.d.ts +6 -6
  141. package/lib/factory.js +132 -136
  142. package/lib/impl/dynamic.d.ts +33 -0
  143. package/lib/impl/dynamic.js +75 -0
  144. package/lib/index-browser.d.ts +3 -1
  145. package/lib/index-browser.js +0 -3
  146. package/lib/index.d.ts +3 -1
  147. package/lib/index.js +1 -13
  148. package/lib/types/api/applySettings.d.ts +13 -13
  149. package/lib/types/api/authenticateDevice.d.ts +33 -24
  150. package/lib/types/api/authorizeCoinjoin.d.ts +10 -10
  151. package/lib/types/api/binance/index.d.ts +143 -143
  152. package/lib/types/api/binance/index.js +1 -1
  153. package/lib/types/api/bitcoin/index.d.ts +11 -11
  154. package/lib/types/api/bitcoin/index.js +1 -1
  155. package/lib/types/api/blockchainEvmRpcCall.d.ts +4 -0
  156. package/lib/types/api/{checkFirmwareAuthenticity.js → blockchainEvmRpcCall.js} +1 -1
  157. package/lib/types/api/cancelCoinjoinAuthorization.d.ts +1 -1
  158. package/lib/types/api/cardano/index.d.ts +507 -507
  159. package/lib/types/api/changeLanguage.d.ts +6 -6
  160. package/lib/types/api/cipherKeyValue.d.ts +8 -8
  161. package/lib/types/api/cipherKeyValue.js +1 -1
  162. package/lib/types/api/composeTransaction.d.ts +13 -7
  163. package/lib/types/api/eos/index.d.ts +525 -525
  164. package/lib/types/api/eos/index.js +1 -1
  165. package/lib/types/api/ethereum/index.d.ts +100 -100
  166. package/lib/types/api/firmwareUpdate.d.ts +5 -5
  167. package/lib/types/api/getAccountDescriptor.d.ts +4 -4
  168. package/lib/types/api/getAddress.d.ts +32 -32
  169. package/lib/types/api/getOwnershipId.d.ts +24 -24
  170. package/lib/types/api/getOwnershipProof.d.ts +28 -28
  171. package/lib/types/api/getPublicKey.d.ts +24 -24
  172. package/lib/types/api/getPublicKey.js +1 -1
  173. package/lib/types/api/index.d.ts +4 -8
  174. package/lib/types/api/init.d.ts +4 -2
  175. package/lib/types/api/loadDevice.d.ts +4 -0
  176. package/lib/types/api/loadDevice.js +3 -0
  177. package/lib/types/api/nem/index.d.ts +612 -612
  178. package/lib/types/api/nem/index.js +1 -1
  179. package/lib/types/api/nemGetAddress.d.ts +6 -6
  180. package/lib/types/api/pushTransaction.d.ts +3 -3
  181. package/lib/types/api/recoveryDevice.d.ts +9 -9
  182. package/lib/types/api/requestLogin.d.ts +25 -25
  183. package/lib/types/api/ripple/index.d.ts +21 -21
  184. package/lib/types/api/ripple/index.js +1 -1
  185. package/lib/types/api/solana/index.d.ts +23 -23
  186. package/lib/types/api/solana/index.js +1 -1
  187. package/lib/types/api/stellar/index.d.ts +582 -582
  188. package/lib/types/api/stellar/index.js +1 -1
  189. package/lib/types/api/tezos/index.d.ts +120 -120
  190. package/lib/types/api/tezos/index.js +1 -1
  191. package/lib/types/api/unlockPath.d.ts +2 -2
  192. package/lib/types/coinInfo.d.ts +231 -224
  193. package/lib/types/device.d.ts +33 -14
  194. package/lib/types/device.js +3 -1
  195. package/lib/types/fees.d.ts +19 -19
  196. package/lib/types/firmware.d.ts +1 -1
  197. package/lib/types/params.d.ts +23 -19
  198. package/lib/types/settings.d.ts +17 -10
  199. package/lib/types/utils.d.ts +1 -0
  200. package/lib/types/utils.js +3 -0
  201. package/lib/utils/addressUtils.js +2 -2
  202. package/lib/utils/assetUtils.d.ts +1 -1
  203. package/lib/utils/assetUtils.js +6 -6
  204. package/lib/utils/assets.js +1 -1
  205. package/lib/utils/assets.native.js +1 -1
  206. package/lib/utils/deviceFeaturesUtils.js +1 -1
  207. package/lib/utils/proxy-event-emitter.d.ts +21 -0
  208. package/lib/utils/proxy-event-emitter.js +65 -0
  209. package/lib/utils/uiPromiseManager.d.ts +2 -1
  210. package/lib/utils/uiPromiseManager.js +3 -3
  211. package/package.json +12 -12
  212. package/lib/api/checkFirmwareAuthenticity.d.ts +0 -11
  213. package/lib/api/checkFirmwareAuthenticity.js +0 -56
  214. package/lib/types/api/checkFirmwareAuthenticity.d.ts +0 -11
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const protobuf_1 = require("@trezor/protobuf");
4
+ const schema_utils_1 = require("@trezor/schema-utils");
3
5
  const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
6
  const paramsValidator_1 = require("../../common/paramsValidator");
5
7
  const pathUtils_1 = require("../../../utils/pathUtils");
@@ -11,8 +13,6 @@ const ethereumSignTypedData_1 = require("../ethereumSignTypedData");
11
13
  const formatUtils_1 = require("../../../utils/formatUtils");
12
14
  const ethereumDefinitions_1 = require("../ethereumDefinitions");
13
15
  const types_1 = require("../../../types");
14
- const protobuf_1 = require("@trezor/protobuf");
15
- const schema_utils_1 = require("@trezor/schema-utils");
16
16
  const Params = schema_utils_1.Type.Intersect([
17
17
  schema_utils_1.Type.Union([
18
18
  schema_utils_1.Type.Omit(ethereum_1.EthereumSignTypedData, schema_utils_1.Type.Literal('path')),
@@ -27,6 +27,7 @@ const Params = schema_utils_1.Type.Intersect([
27
27
  class EthereumSignTypedData extends AbstractMethod_1.AbstractMethod {
28
28
  init() {
29
29
  this.requiredPermissions = ['read', 'write'];
30
+ this.requiredDeviceCapabilities = ['Capability_Ethereum'];
30
31
  const { payload } = this;
31
32
  (0, schema_utils_1.Assert)(schema_utils_1.Type.Union([ethereum_1.EthereumSignTypedData, ethereum_1.EthereumSignTypedHash]), payload);
32
33
  const path = (0, pathUtils_1.validatePath)(payload.path, 3);
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("../../common/paramsValidator");
5
6
  const formatUtils_1 = require("../../../utils/formatUtils");
6
- const schema_utils_1 = require("@trezor/schema-utils");
7
7
  const types_1 = require("../../../types");
8
8
  class EthereumVerifyMessage extends AbstractMethod_1.AbstractMethod {
9
9
  init() {
10
10
  this.requiredPermissions = ['read', 'write'];
11
11
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, this.firmwareRange);
12
+ this.requiredDeviceCapabilities = ['Capability_Ethereum'];
12
13
  const { payload } = this;
13
14
  (0, schema_utils_1.Assert)(types_1.EthereumVerifyMessage, payload);
14
15
  const messageHex = payload.hex
@@ -1,6 +1,6 @@
1
1
  import { MessagesSchema } from '@trezor/protobuf';
2
- import { EthereumNetworkInfo } from '../../types';
3
2
  import { Static } from '@trezor/schema-utils';
3
+ import { EthereumNetworkInfo } from '../../types';
4
4
  interface GetEthereumDefinitions {
5
5
  chainId?: number;
6
6
  slip44?: number;
@@ -12,33 +12,33 @@ export declare const getEthereumDefinitions: ({ chainId, slip44, contractAddress
12
12
  }>;
13
13
  export type EthereumNetworkDefinitionDecoded = Static<typeof EthereumNetworkDefinitionDecoded>;
14
14
  export declare const EthereumNetworkDefinitionDecoded: import("@trezor/schema-utils").TObject<{
15
- chain_id: import("@sinclair/typebox").TNumber;
16
- name: import("@sinclair/typebox").TString;
17
- slip44: import("@sinclair/typebox").TNumber;
18
- symbol: import("@sinclair/typebox").TString;
15
+ chain_id: import("@trezor/schema-utils").TNumber;
16
+ name: import("@trezor/schema-utils").TString;
17
+ slip44: import("@trezor/schema-utils").TNumber;
18
+ symbol: import("@trezor/schema-utils").TString;
19
19
  }>;
20
20
  export type EthereumTokenDefinitionDecoded = Static<typeof EthereumTokenDefinitionDecoded>;
21
21
  export declare const EthereumTokenDefinitionDecoded: import("@trezor/schema-utils").TObject<{
22
- address: import("@sinclair/typebox").TString;
23
- chain_id: import("@sinclair/typebox").TNumber;
24
- decimals: import("@sinclair/typebox").TNumber;
25
- name: import("@sinclair/typebox").TString;
26
- symbol: import("@sinclair/typebox").TString;
22
+ address: import("@trezor/schema-utils").TString;
23
+ chain_id: import("@trezor/schema-utils").TNumber;
24
+ decimals: import("@trezor/schema-utils").TNumber;
25
+ name: import("@trezor/schema-utils").TString;
26
+ symbol: import("@trezor/schema-utils").TString;
27
27
  }>;
28
28
  export type EthereumDefinitionDecoded = Static<typeof EthereumDefinitionDecoded>;
29
29
  export declare const EthereumDefinitionDecoded: import("@trezor/schema-utils").TObject<{
30
- network: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils").TObject<{
31
- chain_id: import("@sinclair/typebox").TNumber;
32
- name: import("@sinclair/typebox").TString;
33
- slip44: import("@sinclair/typebox").TNumber;
34
- symbol: import("@sinclair/typebox").TString;
30
+ network: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
31
+ chain_id: import("@trezor/schema-utils").TNumber;
32
+ name: import("@trezor/schema-utils").TString;
33
+ slip44: import("@trezor/schema-utils").TNumber;
34
+ symbol: import("@trezor/schema-utils").TString;
35
35
  }>>;
36
- token: import("@sinclair/typebox").TOptional<import("@trezor/schema-utils").TObject<{
37
- address: import("@sinclair/typebox").TString;
38
- chain_id: import("@sinclair/typebox").TNumber;
39
- decimals: import("@sinclair/typebox").TNumber;
40
- name: import("@sinclair/typebox").TString;
41
- symbol: import("@sinclair/typebox").TString;
36
+ token: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
37
+ address: import("@trezor/schema-utils").TString;
38
+ chain_id: import("@trezor/schema-utils").TNumber;
39
+ decimals: import("@trezor/schema-utils").TNumber;
40
+ name: import("@trezor/schema-utils").TString;
41
+ symbol: import("@trezor/schema-utils").TString;
42
42
  }>>;
43
43
  }>;
44
44
  export declare const decodeEthereumDefinition: (encodedDefinition: MessagesSchema.EthereumDefinitions) => EthereumDefinitionDecoded;
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ethereumNetworkInfoFromDefinition = exports.decodeEthereumDefinition = exports.EthereumDefinitionDecoded = exports.EthereumTokenDefinitionDecoded = exports.EthereumNetworkDefinitionDecoded = exports.getEthereumDefinitions = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const cross_fetch_1 = tslib_1.__importDefault(require("cross-fetch"));
6
- const protocol_1 = require("@trezor/protocol");
7
6
  const protobuf_1 = require("@trezor/protobuf");
7
+ const protocol_1 = require("@trezor/protocol");
8
+ const schema_utils_1 = require("@trezor/schema-utils");
8
9
  const DataManager_1 = require("../../data/DataManager");
9
10
  const coinInfo_1 = require("../../data/coinInfo");
10
- const schema_utils_1 = require("@trezor/schema-utils");
11
11
  const getEthereumDefinitions = async ({ chainId, slip44, contractAddress, }) => {
12
12
  const definitions = {};
13
13
  if (!chainId && !slip44) {
@@ -101,9 +101,10 @@ const ethereumNetworkInfoFromDefinition = (definition) => ({
101
101
  connect: true,
102
102
  T1B1: '1.6.2',
103
103
  T2T1: '2.0.7',
104
- T2B1: '2.6.1',
105
- T3B1: '2.8.1',
106
- T3T1: '2.7.1',
104
+ T2B1: '2.0.0',
105
+ T3B1: '2.0.0',
106
+ T3T1: '2.0.0',
107
+ T3W1: '2.0.0',
107
108
  },
108
109
  blockchainLink: undefined,
109
110
  });
@@ -1,11 +1,10 @@
1
- import { FirmwareRelease, IntermediaryVersion } from '../../types';
1
+ import { FirmwareRelease } from '../../types';
2
2
  interface GetBinaryProps {
3
3
  baseUrl: string;
4
4
  btcOnly?: boolean;
5
- version?: number[];
6
- intermediaryVersion?: IntermediaryVersion;
7
- releases: FirmwareRelease[];
5
+ release: FirmwareRelease;
8
6
  }
9
- export declare const getBinary: ({ releases, baseUrl, version, btcOnly, intermediaryVersion, }: GetBinaryProps) => Promise<ArrayBuffer>;
7
+ export declare const getBinary: ({ baseUrl, btcOnly, release }: GetBinaryProps) => Promise<ArrayBuffer>;
8
+ export declare const getBinaryOptional: (props: GetBinaryProps) => Promise<ArrayBuffer | null>;
10
9
  export {};
11
10
  //# sourceMappingURL=getBinary.d.ts.map
@@ -1,21 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBinary = void 0;
4
- const utils_1 = require("@trezor/utils");
3
+ exports.getBinaryOptional = exports.getBinary = void 0;
5
4
  const assets_1 = require("../../utils/assets");
6
- const getBinary = ({ releases, baseUrl, version, btcOnly, intermediaryVersion, }) => {
7
- if (intermediaryVersion) {
8
- return (0, assets_1.httpRequest)(`${baseUrl}/firmware/t1b1/trezor-t1b1-inter-v${intermediaryVersion}.bin`, 'binary');
9
- }
10
- const releaseByFirmware = releases.find(r => version &&
11
- utils_1.versionUtils.isVersionArray(version) &&
12
- utils_1.versionUtils.isEqual(r.version, version));
13
- if (releaseByFirmware === undefined) {
14
- throw new Error('no firmware found for this device');
15
- }
16
- const fwUrl = releaseByFirmware[btcOnly ? 'url_bitcoinonly' : 'url'];
5
+ const getBinary = ({ baseUrl, btcOnly, release }) => {
6
+ const fwUrl = release[btcOnly ? 'url_bitcoinonly' : 'url'];
17
7
  const url = `${baseUrl}/${fwUrl}`;
18
8
  return (0, assets_1.httpRequest)(url, 'binary');
19
9
  };
20
10
  exports.getBinary = getBinary;
11
+ const getBinaryOptional = async (props) => {
12
+ try {
13
+ return await (0, exports.getBinary)(props);
14
+ }
15
+ catch {
16
+ return null;
17
+ }
18
+ };
19
+ exports.getBinaryOptional = getBinaryOptional;
21
20
  //# sourceMappingURL=getBinary.js.map
@@ -1,11 +1,11 @@
1
1
  import { GetInfoProps } from '../../data/firmwareInfo';
2
- import { IntermediaryVersion } from '../../types';
2
+ import { IntermediaryVersion, VersionArray } from '../../types';
3
3
  interface GetBinaryForFirmwareUpgradeProps extends GetInfoProps {
4
4
  baseUrl: string;
5
5
  btcOnly?: boolean;
6
- version?: number[];
6
+ version?: VersionArray;
7
7
  intermediaryVersion?: IntermediaryVersion;
8
8
  }
9
- export declare const getBinaryForFirmwareUpgrade: ({ features, releases, baseUrl, version, btcOnly, intermediaryVersion, }: GetBinaryForFirmwareUpgradeProps) => Promise<ArrayBuffer>;
9
+ export declare const getBinaryForFirmwareUpgrade: ({ releases, baseUrl, version, btcOnly, intermediaryVersion, features, }: GetBinaryForFirmwareUpgradeProps) => Promise<ArrayBuffer>;
10
10
  export {};
11
11
  //# sourceMappingURL=getBinaryForFirmwareUpgrade.d.ts.map
@@ -6,7 +6,7 @@ const assets_1 = require("../../utils/assets");
6
6
  const firmwareUtils_1 = require("../../utils/firmwareUtils");
7
7
  const firmwareInfo_1 = require("../../data/firmwareInfo");
8
8
  const getBinary_1 = require("./getBinary");
9
- const getBinaryForFirmwareUpgrade = ({ features, releases, baseUrl, version, btcOnly, intermediaryVersion, }) => {
9
+ const getBinaryForFirmwareUpgrade = ({ releases, baseUrl, version, btcOnly, intermediaryVersion, features, }) => {
10
10
  if (!(0, firmwareUtils_1.isStrictFeatures)(features)) {
11
11
  throw new Error('Features of unexpected shape provided');
12
12
  }
@@ -26,7 +26,7 @@ const getBinaryForFirmwareUpgrade = ({ features, releases, baseUrl, version, btc
26
26
  if (!utils_1.versionUtils.isEqual(releaseByFirmware.version, infoByBootloader.release.version)) {
27
27
  throw new Error(`version provided as param (${releaseByFirmware.version}) does not match firmware version found by features in bootloader (${infoByBootloader.release.version})`);
28
28
  }
29
- return (0, getBinary_1.getBinary)({ releases, baseUrl, version, btcOnly, intermediaryVersion });
29
+ return (0, getBinary_1.getBinary)({ release: releaseByFirmware, baseUrl, btcOnly });
30
30
  };
31
31
  exports.getBinaryForFirmwareUpgrade = getBinaryForFirmwareUpgrade;
32
32
  //# sourceMappingURL=getBinaryForFirmwareUpgrade.js.map
@@ -1,5 +1,5 @@
1
1
  export { getBinaryForFirmwareUpgrade } from './getBinaryForFirmwareUpgrade';
2
- export { getBinary } from './getBinary';
2
+ export { getBinary, getBinaryOptional } from './getBinary';
3
3
  export { getLanguage } from '../../data/getLanguage';
4
4
  export { shouldStripFwHeaders, stripFwHeaders } from './modifyFirmware';
5
5
  export { uploadFirmware } from './uploadFirmware';
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseFirmwareHeaders = exports.calculateFirmwareHash = exports.uploadFirmware = exports.stripFwHeaders = exports.shouldStripFwHeaders = exports.getLanguage = exports.getBinary = exports.getBinaryForFirmwareUpgrade = void 0;
3
+ exports.parseFirmwareHeaders = exports.calculateFirmwareHash = exports.uploadFirmware = exports.stripFwHeaders = exports.shouldStripFwHeaders = exports.getLanguage = exports.getBinaryOptional = exports.getBinary = exports.getBinaryForFirmwareUpgrade = void 0;
4
4
  var getBinaryForFirmwareUpgrade_1 = require("./getBinaryForFirmwareUpgrade");
5
5
  Object.defineProperty(exports, "getBinaryForFirmwareUpgrade", { enumerable: true, get: function () { return getBinaryForFirmwareUpgrade_1.getBinaryForFirmwareUpgrade; } });
6
6
  var getBinary_1 = require("./getBinary");
7
7
  Object.defineProperty(exports, "getBinary", { enumerable: true, get: function () { return getBinary_1.getBinary; } });
8
+ Object.defineProperty(exports, "getBinaryOptional", { enumerable: true, get: function () { return getBinary_1.getBinaryOptional; } });
8
9
  var getLanguage_1 = require("../../data/getLanguage");
9
10
  Object.defineProperty(exports, "getLanguage", { enumerable: true, get: function () { return getLanguage_1.getLanguage; } });
10
11
  var modifyFirmware_1 = require("./modifyFirmware");
@@ -40,11 +40,9 @@ const derToAsn1 = (byteArray) => {
40
40
  if (byteArray[position] === 0x80) {
41
41
  throw new Error('Unsupported length encoding');
42
42
  }
43
- let length = getLength();
44
- let byteLength;
45
- let contents;
46
- byteLength = position + length;
47
- contents = byteArray.subarray(position, byteLength);
43
+ const length = getLength();
44
+ const byteLength = position + length;
45
+ const contents = byteArray.subarray(position, byteLength);
48
46
  const raw = byteArray.subarray(0, byteLength);
49
47
  return {
50
48
  cls,
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("./common/paramsValidator");
5
6
  const pathUtils_1 = require("../utils/pathUtils");
@@ -9,7 +10,6 @@ const constants_1 = require("../constants");
9
10
  const events_1 = require("../events");
10
11
  const types_1 = require("../types");
11
12
  const getAccountDescriptor_1 = require("../types/api/getAccountDescriptor");
12
- const schema_utils_1 = require("@trezor/schema-utils");
13
13
  class GetAccountDescriptor extends AbstractMethod_1.AbstractMethod {
14
14
  constructor() {
15
15
  super(...arguments);
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("./common/paramsValidator");
5
6
  const pathUtils_1 = require("../utils/pathUtils");
@@ -7,7 +8,6 @@ const coinInfo_1 = require("../data/coinInfo");
7
8
  const constants_1 = require("../constants");
8
9
  const events_1 = require("../events");
9
10
  const types_1 = require("../types");
10
- const schema_utils_1 = require("@trezor/schema-utils");
11
11
  const getAddress_1 = require("../types/api/getAddress");
12
12
  class GetAddress extends AbstractMethod_1.AbstractMethod {
13
13
  constructor() {
@@ -23,6 +23,7 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
23
23
  T2B1: string | false;
24
24
  T3B1: string | false;
25
25
  T3T1: string | false;
26
+ T3W1: string | false;
26
27
  connect: boolean;
27
28
  };
28
29
  decimals: number;
@@ -80,6 +81,7 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
80
81
  T2B1: string | false;
81
82
  T3B1: string | false;
82
83
  T3T1: string | false;
84
+ T3W1: string | false;
83
85
  connect: boolean;
84
86
  };
85
87
  decimals: number;
@@ -112,6 +114,7 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
112
114
  T2B1: string | false;
113
115
  T3B1: string | false;
114
116
  T3T1: string | false;
117
+ T3W1: string | false;
115
118
  connect: boolean;
116
119
  };
117
120
  decimals: number;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const constants_1 = require("../constants");
5
6
  const coinInfo_1 = require("../data/coinInfo");
6
7
  const types_1 = require("../types");
7
- const schema_utils_1 = require("@trezor/schema-utils");
8
8
  class GetCoinInfo extends AbstractMethod_1.AbstractMethod {
9
9
  init() {
10
10
  this.requiredPermissions = [];
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const constants_1 = require("../constants");
5
6
  const events_1 = require("../events");
6
7
  const paramsValidator_1 = require("./common/paramsValidator");
7
- const schema_utils_1 = require("@trezor/schema-utils");
8
8
  class GetFirmwareHash extends AbstractMethod_1.AbstractMethod {
9
9
  init() {
10
10
  this.requiredPermissions = ['management'];
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("./common/paramsValidator");
5
6
  const pathUtils_1 = require("../utils/pathUtils");
6
7
  const coinInfo_1 = require("../data/coinInfo");
7
8
  const events_1 = require("../events");
8
- const schema_utils_1 = require("@trezor/schema-utils");
9
9
  const exports_1 = require("../exports");
10
10
  const getOwnershipId_1 = require("../types/api/getOwnershipId");
11
11
  class GetOwnershipId extends AbstractMethod_1.AbstractMethod {
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("./common/paramsValidator");
5
6
  const pathUtils_1 = require("../utils/pathUtils");
6
7
  const coinInfo_1 = require("../data/coinInfo");
7
8
  const events_1 = require("../events");
8
- const schema_utils_1 = require("@trezor/schema-utils");
9
9
  const exports_1 = require("../exports");
10
10
  const getOwnershipProof_1 = require("../types/api/getOwnershipProof");
11
11
  class GetOwnershipProof extends AbstractMethod_1.AbstractMethod {
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("./common/paramsValidator");
5
6
  const pathUtils_1 = require("../utils/pathUtils");
6
7
  const events_1 = require("../events");
7
8
  const coinInfo_1 = require("../data/coinInfo");
8
9
  const accountUtils_1 = require("../utils/accountUtils");
9
- const schema_utils_1 = require("@trezor/schema-utils");
10
10
  const types_1 = require("../types");
11
11
  const getPublicKey_1 = require("../types/api/getPublicKey");
12
12
  class GetPublicKey extends AbstractMethod_1.AbstractMethod {
@@ -9,6 +9,7 @@ export { default as blockchainDisconnect } from './blockchainDisconnect';
9
9
  export { default as blockchainEstimateFee } from './blockchainEstimateFee';
10
10
  export { default as blockchainGetAccountBalanceHistory } from './blockchainGetAccountBalanceHistory';
11
11
  export { default as blockchainGetCurrentFiatRates } from './blockchainGetCurrentFiatRates';
12
+ export { default as blockchainEvmRpcCall } from './blockchainEvmRpcCall';
12
13
  export { default as blockchainGetFiatRatesForTimestamps } from './blockchainGetFiatRatesForTimestamps';
13
14
  export { default as blockchainGetTransactions } from './blockchainGetTransactions';
14
15
  export { default as blockchainSetCustomBackend } from './blockchainSetCustomBackend';
@@ -37,6 +38,7 @@ export { default as rebootToBootloader } from './rebootToBootloader';
37
38
  export { default as recoveryDevice } from './recoveryDevice';
38
39
  export { default as requestLogin } from './requestLogin';
39
40
  export { default as resetDevice } from './resetDevice';
41
+ export { default as loadDevice } from './loadDevice';
40
42
  export { default as setBrightness } from './setBrightness';
41
43
  export { default as setBusy } from './setBusy';
42
44
  export { default as setProxy } from './setProxy';
@@ -45,5 +47,4 @@ export { default as signTransaction } from './signTransaction';
45
47
  export { default as unlockPath } from './unlockPath';
46
48
  export { default as verifyMessage } from './verifyMessage';
47
49
  export { default as wipeDevice } from './wipeDevice';
48
- export { default as checkFirmwareAuthenticity } from './checkFirmwareAuthenticity';
49
50
  //# sourceMappingURL=index.d.ts.map
package/lib/api/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.unlockPath = exports.signTransaction = exports.signMessage = exports.setProxy = exports.setBusy = exports.setBrightness = exports.resetDevice = exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.getAccountDescriptor = exports.composeTransaction = exports.cipherKeyValue = exports.changeWipeCode = exports.changePin = exports.changeLanguage = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.backupDevice = exports.showDeviceTutorial = exports.cancelCoinjoinAuthorization = exports.authorizeCoinjoin = exports.authenticateDevice = exports.applySettings = exports.applyFlags = void 0;
3
+ exports.wipeDevice = exports.verifyMessage = exports.unlockPath = exports.signTransaction = exports.signMessage = exports.setProxy = exports.setBusy = exports.setBrightness = exports.loadDevice = exports.resetDevice = exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.getAccountDescriptor = exports.composeTransaction = exports.cipherKeyValue = exports.changeWipeCode = exports.changePin = exports.changeLanguage = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainEvmRpcCall = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.backupDevice = exports.showDeviceTutorial = exports.cancelCoinjoinAuthorization = exports.authorizeCoinjoin = exports.authenticateDevice = exports.applySettings = exports.applyFlags = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  var applyFlags_1 = require("./applyFlags");
6
6
  Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return tslib_1.__importDefault(applyFlags_1).default; } });
@@ -24,6 +24,8 @@ var blockchainGetAccountBalanceHistory_1 = require("./blockchainGetAccountBalanc
24
24
  Object.defineProperty(exports, "blockchainGetAccountBalanceHistory", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainGetAccountBalanceHistory_1).default; } });
25
25
  var blockchainGetCurrentFiatRates_1 = require("./blockchainGetCurrentFiatRates");
26
26
  Object.defineProperty(exports, "blockchainGetCurrentFiatRates", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainGetCurrentFiatRates_1).default; } });
27
+ var blockchainEvmRpcCall_1 = require("./blockchainEvmRpcCall");
28
+ Object.defineProperty(exports, "blockchainEvmRpcCall", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainEvmRpcCall_1).default; } });
27
29
  var blockchainGetFiatRatesForTimestamps_1 = require("./blockchainGetFiatRatesForTimestamps");
28
30
  Object.defineProperty(exports, "blockchainGetFiatRatesForTimestamps", { enumerable: true, get: function () { return tslib_1.__importDefault(blockchainGetFiatRatesForTimestamps_1).default; } });
29
31
  var blockchainGetTransactions_1 = require("./blockchainGetTransactions");
@@ -80,6 +82,8 @@ var requestLogin_1 = require("./requestLogin");
80
82
  Object.defineProperty(exports, "requestLogin", { enumerable: true, get: function () { return tslib_1.__importDefault(requestLogin_1).default; } });
81
83
  var resetDevice_1 = require("./resetDevice");
82
84
  Object.defineProperty(exports, "resetDevice", { enumerable: true, get: function () { return tslib_1.__importDefault(resetDevice_1).default; } });
85
+ var loadDevice_1 = require("./loadDevice");
86
+ Object.defineProperty(exports, "loadDevice", { enumerable: true, get: function () { return tslib_1.__importDefault(loadDevice_1).default; } });
83
87
  var setBrightness_1 = require("./setBrightness");
84
88
  Object.defineProperty(exports, "setBrightness", { enumerable: true, get: function () { return tslib_1.__importDefault(setBrightness_1).default; } });
85
89
  var setBusy_1 = require("./setBusy");
@@ -96,6 +100,4 @@ var verifyMessage_1 = require("./verifyMessage");
96
100
  Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return tslib_1.__importDefault(verifyMessage_1).default; } });
97
101
  var wipeDevice_1 = require("./wipeDevice");
98
102
  Object.defineProperty(exports, "wipeDevice", { enumerable: true, get: function () { return tslib_1.__importDefault(wipeDevice_1).default; } });
99
- var checkFirmwareAuthenticity_1 = require("./checkFirmwareAuthenticity");
100
- Object.defineProperty(exports, "checkFirmwareAuthenticity", { enumerable: true, get: function () { return tslib_1.__importDefault(checkFirmwareAuthenticity_1).default; } });
101
103
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,14 @@
1
+ import { AbstractMethod } from '../core/AbstractMethod';
2
+ import { PROTO } from '../constants';
3
+ export default class LoadDevice extends AbstractMethod<'loadDevice', PROTO.LoadDevice> {
4
+ init(): void;
5
+ get info(): string;
6
+ get confirmation(): {
7
+ view: "device-management";
8
+ label: string;
9
+ };
10
+ run(): Promise<{
11
+ message: string;
12
+ }>;
13
+ }
14
+ //# sourceMappingURL=loadDevice.d.ts.map
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
4
+ const AbstractMethod_1 = require("../core/AbstractMethod");
5
+ const events_1 = require("../events");
6
+ const paramsValidator_1 = require("./common/paramsValidator");
7
+ const constants_1 = require("../constants");
8
+ class LoadDevice extends AbstractMethod_1.AbstractMethod {
9
+ init() {
10
+ this.allowDeviceMode = [events_1.UI.INITIALIZE];
11
+ this.useDeviceState = false;
12
+ this.requiredPermissions = ['management'];
13
+ this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, this.firmwareRange);
14
+ const { payload } = this;
15
+ (0, schema_utils_1.Assert)(constants_1.PROTO.LoadDevice, payload);
16
+ this.params = {
17
+ mnemonics: payload.mnemonics,
18
+ pin: payload.pin,
19
+ passphrase_protection: payload.passphrase_protection,
20
+ language: payload.language,
21
+ label: payload.label,
22
+ skip_checksum: payload.skip_checksum,
23
+ u2f_counter: payload.u2f_counter,
24
+ needs_backup: payload.needs_backup,
25
+ no_backup: payload.no_backup,
26
+ };
27
+ }
28
+ get info() {
29
+ return 'Load seed and related internal settings.';
30
+ }
31
+ get confirmation() {
32
+ return {
33
+ view: 'device-management',
34
+ label: 'Do you really you want to load device?',
35
+ };
36
+ }
37
+ async run() {
38
+ const cmd = this.device.getCommands();
39
+ const response = await cmd.typedCall('LoadDevice', 'Success', this.params);
40
+ return response.message;
41
+ }
42
+ }
43
+ exports.default = LoadDevice;
44
+ //# sourceMappingURL=loadDevice.js.map
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("../../common/paramsValidator");
5
6
  const coinInfo_1 = require("../../../data/coinInfo");
6
7
  const pathUtils_1 = require("../../../utils/pathUtils");
7
8
  const constants_1 = require("../../../constants");
8
9
  const events_1 = require("../../../events");
9
- const schema_utils_1 = require("@trezor/schema-utils");
10
10
  const types_1 = require("../../../types");
11
11
  const getAddress_1 = require("../../../types/api/getAddress");
12
12
  const MAINNET = 0x68;
@@ -20,6 +20,7 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
20
20
  init() {
21
21
  this.noBackupConfirmationMode = 'always';
22
22
  this.requiredPermissions = ['read'];
23
+ this.requiredDeviceCapabilities = ['Capability_NEM'];
23
24
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('NEM'), this.firmwareRange);
24
25
  this.hasBundle = !!this.payload.bundle;
25
26
  const payload = !this.payload.bundle
@@ -1,17 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const schema_utils_1 = require("@trezor/schema-utils");
4
5
  const AbstractMethod_1 = require("../../../core/AbstractMethod");
5
6
  const paramsValidator_1 = require("../../common/paramsValidator");
6
7
  const coinInfo_1 = require("../../../data/coinInfo");
7
8
  const pathUtils_1 = require("../../../utils/pathUtils");
8
9
  const helper = tslib_1.__importStar(require("../nemSignTx"));
9
- const schema_utils_1 = require("@trezor/schema-utils");
10
10
  const nem_1 = require("../../../types/api/nem");
11
11
  class NEMSignTransaction extends AbstractMethod_1.AbstractMethod {
12
12
  init() {
13
13
  var _a;
14
14
  this.requiredPermissions = ['read', 'write'];
15
+ this.requiredDeviceCapabilities = ['Capability_NEM'];
15
16
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('NEM'), this.firmwareRange);
16
17
  const { payload } = this;
17
18
  if ((_a = payload === null || payload === void 0 ? void 0 : payload.transaction) === null || _a === void 0 ? void 0 : _a.timestamp) {
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const coinInfo_1 = require("../data/coinInfo");
5
6
  const constants_1 = require("../constants");
6
7
  const BlockchainLink_1 = require("../backend/BlockchainLink");
7
- const schema_utils_1 = require("@trezor/schema-utils");
8
8
  const pushTransaction_1 = require("../types/api/pushTransaction");
9
9
  class PushTransaction extends AbstractMethod_1.AbstractMethod {
10
10
  init() {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("./common/paramsValidator");
5
6
  const events_1 = require("../events");
6
- const schema_utils_1 = require("@trezor/schema-utils");
7
7
  const constants_1 = require("../constants");
8
8
  class RebootToBootloader extends AbstractMethod_1.AbstractMethod {
9
9
  init() {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const events_1 = require("../events");
5
- const schema_utils_1 = require("@trezor/schema-utils");
6
6
  const recoveryDevice_1 = require("../types/api/recoveryDevice");
7
7
  class RecoveryDevice extends AbstractMethod_1.AbstractMethod {
8
8
  init() {
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const paramsValidator_1 = require("./common/paramsValidator");
5
6
  const constants_1 = require("../constants");
6
7
  const events_1 = require("../events");
7
8
  const DataManager_1 = require("../data/DataManager");
8
- const schema_utils_1 = require("@trezor/schema-utils");
9
9
  const requestLogin_1 = require("../types/api/requestLogin");
10
10
  class RequestLogin extends AbstractMethod_1.AbstractMethod {
11
11
  init() {
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const schema_utils_1 = require("@trezor/schema-utils");
3
4
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
5
  const events_1 = require("../events");
5
6
  const paramsValidator_1 = require("./common/paramsValidator");
6
7
  const constants_1 = require("../constants");
7
- const schema_utils_1 = require("@trezor/schema-utils");
8
8
  class ResetDevice extends AbstractMethod_1.AbstractMethod {
9
9
  init() {
10
10
  this.allowDeviceMode = [events_1.UI.INITIALIZE, events_1.UI.SEEDLESS];
@@ -14,7 +14,6 @@ class ResetDevice extends AbstractMethod_1.AbstractMethod {
14
14
  const { payload } = this;
15
15
  (0, schema_utils_1.Assert)(constants_1.PROTO.ResetDevice, payload);
16
16
  this.params = {
17
- display_random: payload.display_random,
18
17
  strength: payload.strength || 256,
19
18
  passphrase_protection: payload.passphrase_protection,
20
19
  pin_protection: payload.pin_protection,