@trezor/connect 9.2.3 → 9.2.4-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 (119) hide show
  1. package/CHANGELOG.md +77 -5
  2. package/README.md +1 -1
  3. package/lib/api/applyFlags.d.ts +8 -1
  4. package/lib/api/applyFlags.js +3 -8
  5. package/lib/api/applySettings.d.ts +8 -1
  6. package/lib/api/applySettings.js +3 -8
  7. package/lib/api/backupDevice.d.ts +10 -2
  8. package/lib/api/backupDevice.js +12 -9
  9. package/lib/api/binance/api/binanceGetAddress.d.ts +4 -3
  10. package/lib/api/binance/api/binanceGetAddress.js +8 -22
  11. package/lib/api/binance/api/binanceGetPublicKey.d.ts +4 -2
  12. package/lib/api/binance/api/binanceGetPublicKey.js +6 -18
  13. package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
  14. package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
  15. package/lib/api/cardano/api/cardanoGetAddress.d.ts +4 -4
  16. package/lib/api/cardano/api/cardanoGetAddress.js +9 -39
  17. package/lib/api/cardano/api/cardanoGetPublicKey.d.ts +4 -3
  18. package/lib/api/cardano/api/cardanoGetPublicKey.js +9 -31
  19. package/lib/api/cardano/api/cardanoSignTransaction.d.ts +1 -13
  20. package/lib/api/cardano/api/cardanoSignTransaction.js +2 -75
  21. package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -2
  22. package/lib/api/cardano/cardanoAddressParameters.js +4 -10
  23. package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -2
  24. package/lib/api/cardano/cardanoAuxiliaryData.js +2 -2
  25. package/lib/api/changeLanguage.d.ts +8 -1
  26. package/lib/api/changeLanguage.js +3 -7
  27. package/lib/api/eos/api/eosGetPublicKey.d.ts +4 -2
  28. package/lib/api/eos/api/eosGetPublicKey.js +6 -18
  29. package/lib/api/ethereum/api/ethereumGetAddress.d.ts +4 -3
  30. package/lib/api/ethereum/api/ethereumGetAddress.js +4 -20
  31. package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +4 -2
  32. package/lib/api/ethereum/api/ethereumGetPublicKey.js +3 -10
  33. package/lib/api/firmware/index.d.ts +2 -0
  34. package/lib/api/firmware/index.js +5 -1
  35. package/lib/api/firmware/parseFirmwareHeaders.d.ts +5 -0
  36. package/lib/api/firmware/parseFirmwareHeaders.js +35 -0
  37. package/lib/api/firmware/uploadFirmware.d.ts +1 -1
  38. package/lib/api/firmware/uploadFirmware.js +9 -1
  39. package/lib/api/getAccountDescriptor.d.ts +5 -3
  40. package/lib/api/getAccountDescriptor.js +8 -21
  41. package/lib/api/getAccountInfo.d.ts +23 -7
  42. package/lib/api/getAccountInfo.js +12 -25
  43. package/lib/api/getAddress.d.ts +4 -3
  44. package/lib/api/getAddress.js +8 -22
  45. package/lib/api/getFeatures.d.ts +1 -0
  46. package/lib/api/getOwnershipId.d.ts +4 -2
  47. package/lib/api/getOwnershipId.js +4 -15
  48. package/lib/api/getOwnershipProof.d.ts +4 -2
  49. package/lib/api/getOwnershipProof.js +4 -15
  50. package/lib/api/getPublicKey.d.ts +5 -4
  51. package/lib/api/getPublicKey.js +12 -35
  52. package/lib/api/index.d.ts +0 -1
  53. package/lib/api/index.js +1 -3
  54. package/lib/api/nem/api/nemGetAddress.d.ts +4 -3
  55. package/lib/api/nem/api/nemGetAddress.js +4 -20
  56. package/lib/api/rebootToBootloader.d.ts +8 -2
  57. package/lib/api/rebootToBootloader.js +3 -10
  58. package/lib/api/recoveryDevice.d.ts +8 -1
  59. package/lib/api/recoveryDevice.js +3 -7
  60. package/lib/api/resetDevice.d.ts +4 -2
  61. package/lib/api/resetDevice.js +3 -10
  62. package/lib/api/ripple/api/rippleGetAddress.d.ts +4 -3
  63. package/lib/api/ripple/api/rippleGetAddress.js +4 -20
  64. package/lib/api/solana/api/solanaGetAddress.d.ts +4 -3
  65. package/lib/api/solana/api/solanaGetAddress.js +7 -28
  66. package/lib/api/solana/api/solanaGetPublicKey.d.ts +4 -3
  67. package/lib/api/solana/api/solanaGetPublicKey.js +7 -27
  68. package/lib/api/stellar/api/stellarGetAddress.d.ts +4 -3
  69. package/lib/api/stellar/api/stellarGetAddress.js +4 -20
  70. package/lib/api/tezos/api/tezosGetAddress.d.ts +4 -3
  71. package/lib/api/tezos/api/tezosGetAddress.js +4 -20
  72. package/lib/api/tezos/api/tezosGetPublicKey.d.ts +4 -2
  73. package/lib/api/tezos/api/tezosGetPublicKey.js +6 -18
  74. package/lib/api/wipeDevice.d.ts +8 -2
  75. package/lib/api/wipeDevice.js +3 -10
  76. package/lib/backend/Blockchain.d.ts +2 -2
  77. package/lib/constants/errors.d.ts +1 -0
  78. package/lib/constants/errors.js +1 -0
  79. package/lib/core/AbstractMethod.d.ts +4 -8
  80. package/lib/core/AbstractMethod.js +6 -28
  81. package/lib/core/index.d.ts +2 -1
  82. package/lib/core/index.js +258 -226
  83. package/lib/core/onCallFirmwareUpdate.d.ts +31 -0
  84. package/lib/core/onCallFirmwareUpdate.js +266 -0
  85. package/lib/data/DataManager.d.ts +10 -0
  86. package/lib/data/analyticsInfo.d.ts +2 -2
  87. package/lib/data/analyticsInfo.js +6 -7
  88. package/lib/data/config.d.ts +10 -0
  89. package/lib/data/config.js +15 -5
  90. package/lib/data/deviceAuthenticityConfig.js +8 -4
  91. package/lib/data/firmwareInfo.js +1 -1
  92. package/lib/data/version.d.ts +1 -1
  93. package/lib/data/version.js +5 -2
  94. package/lib/device/Device.d.ts +2 -2
  95. package/lib/device/Device.js +4 -4
  96. package/lib/device/DeviceCommands.d.ts +4 -16
  97. package/lib/device/DeviceCommands.js +10 -72
  98. package/lib/device/DeviceList.d.ts +7 -4
  99. package/lib/device/DeviceList.js +46 -40
  100. package/lib/events/blockchain.d.ts +2 -2
  101. package/lib/events/index.d.ts +1 -0
  102. package/lib/events/ui-request.d.ts +13 -1
  103. package/lib/events/ui-request.js +1 -0
  104. package/lib/index.js +2 -2
  105. package/lib/types/api/backupDevice.d.ts +2 -2
  106. package/lib/types/api/dispose.d.ts +1 -1
  107. package/lib/types/api/firmwareUpdate.d.ts +7 -6
  108. package/lib/types/api/firmwareUpdate.js +1 -3
  109. package/lib/types/index.d.ts +1 -1
  110. package/lib/types/settings.d.ts +1 -1
  111. package/lib/utils/popupPromiseManager.d.ts +8 -0
  112. package/lib/utils/popupPromiseManager.js +21 -0
  113. package/lib/utils/uiPromiseManager.d.ts +38 -0
  114. package/lib/utils/uiPromiseManager.js +47 -0
  115. package/lib/workers/workers-browser.d.ts +3 -1
  116. package/lib/workers/workers-browser.js +2 -2
  117. package/package.json +9 -9
  118. package/lib/api/firmwareUpdate.d.ts +0 -19
  119. package/lib/api/firmwareUpdate.js +0 -78
package/CHANGELOG.md CHANGED
@@ -1,8 +1,80 @@
1
- | Package | latest stable | latest canary |
2
- | ---------------------------- | :-----------: | :-----------: |
3
- | @trezor/connect | 9.2.2 | 9.2.3 |
4
- | @trezor/connect-web | 9.2.2 | 9.2.3 |
5
- | @trezor/connect-webextension | 9.2.2 | 9.2.3 |
1
+ | Package | stable | canary |
2
+ | -------------------------------- | :----: | :----------: |
3
+ | npm @trezor/connect | 9.2.2 | 9.2.4-beta.2 |
4
+ | npm @trezor/connect-web | 9.2.2 | 9.2.4-beta.2 |
5
+ | npm @trezor/connect-webextension | 9.2.2 | 9.2.4-beta.2 |
6
+ | connect.trezor.io/9 | 9.2.2 | x |
7
+
8
+ # 9.2.4-beta.2
9
+
10
+ - chore(connect): re-add feature support checking in cardanoSignTransaction (acf9ffc2cb)
11
+ - chore(connect): fw-update: add error message when binary is too small (b0c1173f8d)
12
+ - chore(connect): remove legacyresults from cardano fixtures (acd9e1e510)
13
+ - chore(connect): bump fw versions required for cardano (c3d96b3ca7)
14
+ - chore(connect): remove validation in cardanoSignTransaction, cardanoAddressParameters, cardanoGetAddress, device.validateState (33efb4b8bd,013047bdb1, 21fadd17a6, 29311b5d61)
15
+ - feat(connect): use full version in URL when beta (26c70f48f7)
16
+ - fix(connect): simultaneous read of connected devices (f181c988a4)
17
+ - chore(connect): DeviceList now has two params - full settings object and messages (b6167266c9)
18
+ - chore(connect): remove DataManager from DeviceList (afc8760213)
19
+ - chore(connect): remove DataManager dependency from DeviceList constructor (7971515d71)
20
+ - chore(connect): simplify reduce code duplication in DeviceList (0cf8a04ed0)
21
+
22
+ ## connect-explorer
23
+
24
+ - fix(connect-explorer): method testing tool scrollbars (f15f6487d8)
25
+ - fix(connect-explorer): support GitHub emoji (fda80e5aa3)
26
+
27
+ ## connect-popup
28
+
29
+ - fix(connect-popup): use PassphraseTypeCardLegacy (629d6f8671)
30
+
31
+ ## transport
32
+
33
+ - feat(transport): make signal required param in constructor (4b82f8d505)
34
+
35
+ ## Dependencies update
36
+
37
+ - npm-release: @trezor/blockchain-link 2.1.30-beta.2
38
+ - npm-release: @trezor/blockchain-link-types 1.0.17-beta.2
39
+ - npm-release: @trezor/connect-analytics 1.0.15-beta.1
40
+ - npm-release: @trezor/transport 1.1.29-beta.1
41
+
42
+ # 9.2.4-beta.1
43
+
44
+ - feat(connect): BackupDevice now has params (4120912)
45
+ - chore(connect): update protobuf messages (41bff13)
46
+ - chore(connect): add new TS3 CA pubkeys and update timestamp (3ae06ac)
47
+ - chore(connect): remove deprecated code, bump required fw to 1.8.1/2.1.0, fix typo in log, rename firmwareUpdate_v2 to firmwareUpdate (8af325a, 2f14ff6 649a197, b39030c, b67170c)
48
+ - chore(connect): popupPromise improvement, pin retries, invalidDeviceState, flattened onCall/inner (320c5a9,6515f13, 7666994, 99ac0e5, 4aa2b46, fa0974d, 9188727, 08a093b, dd6437e, 27d5a44)
49
+ - fix(connect): intermediary reconnect improved, device authenticity, multi-apps synchronization, reading translations, bin_outputs in txcache (115c718, de1b969, 140ec9a a881142, 88d7608, 0bb13d3)
50
+ - fix(connect): bin_outputs in txcache (0bb13d3)
51
+
52
+ ## connect-popup
53
+
54
+ In general measures to address popup closing unexpectedly were taken. Update of content-script.js will be needed to make these changes effective.
55
+
56
+ - fix(connect-popup): update text in selectAccount (21f4382)
57
+ - fix(connect-popup): add delay before popup bootstrap to allow contentscript load (00b2056)
58
+ - fix(connect-popup): webextension example e2e (b9cce02)
59
+ - fix(connect-popup): typo in a comment (8e21eeb)
60
+ - fix(connect-popup): queue messages sent before init (8850665)
61
+ - fix(connect-popup): delay popup.js loading to allow content script to init (92d15bc)
62
+ - fix(connect-popup): wait for POPUP.LOADED in webextension (cb18673)
63
+
64
+ ## connect-explorer
65
+
66
+ Connect-explorer has been completely revamped into a new design :tada:
67
+
68
+ ## Dependencies update
69
+
70
+ - npm-release: @trezor/blockchain-link-utils 1.0.18-beta.1
71
+ - npm-release: @trezor/blockchain-link-types 1.0.17-beta.1
72
+ - npm-release: @trezor/analytics 1.0.17-beta.1
73
+ - npm-release: @trezor/connect-common 0.0.33-beta.1
74
+ - npm-release: @trezor/env-utils 1.0.17-beta.1
75
+ - npm-release: @trezor/protobuf 1.0.13-beta.1
76
+ - npm-release: @trezor/schema-utils 1.0.4-beta.1
77
+ - npm-release: @trezor/protocol 1.0.9-beta.1
6
78
 
7
79
  # 9.2.3
8
80
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @trezor/connect
2
2
 
3
- API version 9.2.3
3
+ API version 9.2.4-beta.2
4
4
 
5
5
  [![Build Status](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml/badge.svg)](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
6
6
  [![NPM](https://img.shields.io/npm/v/@trezor/connect.svg)](https://www.npmjs.org/package/@trezor/connect)
@@ -2,7 +2,14 @@ import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
3
  export default class ApplyFlags extends AbstractMethod<'applyFlags', PROTO.ApplyFlags> {
4
4
  init(): void;
5
- confirmation(): Promise<boolean>;
5
+ get confirmation(): {
6
+ view: "device-management";
7
+ customConfirmButton: {
8
+ className: string;
9
+ label: string;
10
+ };
11
+ label: string;
12
+ };
6
13
  run(): Promise<{
7
14
  message: string;
8
15
  }>;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const events_1 = require("../events");
5
4
  const constants_1 = require("../constants");
6
5
  const schema_utils_1 = require("@trezor/schema-utils");
7
6
  class ApplyFlags extends AbstractMethod_1.AbstractMethod {
@@ -14,19 +13,15 @@ class ApplyFlags extends AbstractMethod_1.AbstractMethod {
14
13
  flags: payload.flags,
15
14
  };
16
15
  }
17
- async confirmation() {
18
- await this.getPopupPromise().promise;
19
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
20
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
16
+ get confirmation() {
17
+ return {
21
18
  view: 'device-management',
22
19
  customConfirmButton: {
23
20
  className: 'confirm',
24
21
  label: 'Proceed',
25
22
  },
26
23
  label: 'Do you really want to apply flags?',
27
- }));
28
- const uiResp = await uiPromise.promise;
29
- return uiResp.payload;
24
+ };
30
25
  }
31
26
  async run() {
32
27
  const cmd = this.device.getCommands();
@@ -2,7 +2,14 @@ import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
3
  export default class ApplySettings extends AbstractMethod<'applySettings', PROTO.ApplySettings> {
4
4
  init(): void;
5
- confirmation(): Promise<boolean>;
5
+ get confirmation(): {
6
+ view: "device-management";
7
+ customConfirmButton: {
8
+ className: string;
9
+ label: string;
10
+ };
11
+ label: string;
12
+ };
6
13
  run(): Promise<{
7
14
  message: string;
8
15
  }>;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const events_1 = require("../events");
5
4
  const schema_utils_1 = require("@trezor/schema-utils");
6
5
  const applySettings_1 = require("../types/api/applySettings");
7
6
  class ApplySettings extends AbstractMethod_1.AbstractMethod {
@@ -23,19 +22,15 @@ class ApplySettings extends AbstractMethod_1.AbstractMethod {
23
22
  _passphrase_source: payload.passphrase_source,
24
23
  };
25
24
  }
26
- async confirmation() {
27
- await this.getPopupPromise().promise;
28
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
29
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
25
+ get confirmation() {
26
+ return {
30
27
  view: 'device-management',
31
28
  customConfirmButton: {
32
29
  className: 'confirm',
33
30
  label: 'Proceed',
34
31
  },
35
32
  label: 'Do you really want to change device settings?',
36
- }));
37
- const uiResp = await uiPromise.promise;
38
- return uiResp.payload;
33
+ };
39
34
  }
40
35
  async run() {
41
36
  const cmd = this.device.getCommands();
@@ -1,7 +1,15 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
- export default class BackupDevice extends AbstractMethod<'backupDevice'> {
2
+ import { PROTO } from '../constants';
3
+ export default class BackupDevice extends AbstractMethod<'backupDevice', PROTO.BackupDevice> {
3
4
  init(): void;
4
- confirmation(): Promise<boolean>;
5
+ get confirmation(): {
6
+ view: "device-management";
7
+ customConfirmButton: {
8
+ className: string;
9
+ label: string;
10
+ };
11
+ label: string;
12
+ };
5
13
  run(): Promise<{
6
14
  message: string;
7
15
  }>;
@@ -1,29 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const events_1 = require("../events");
4
+ const constants_1 = require("../constants");
5
+ const schema_utils_1 = require("@trezor/schema-utils");
5
6
  class BackupDevice extends AbstractMethod_1.AbstractMethod {
6
7
  init() {
7
8
  this.requiredPermissions = ['management'];
8
9
  this.useDeviceState = false;
10
+ const { payload } = this;
11
+ (0, schema_utils_1.Assert)(constants_1.PROTO.BackupDevice, payload);
12
+ this.params = {
13
+ group_threshold: payload.group_threshold,
14
+ groups: payload.groups,
15
+ };
9
16
  }
10
- async confirmation() {
11
- await this.getPopupPromise().promise;
12
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
13
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
17
+ get confirmation() {
18
+ return {
14
19
  view: 'device-management',
15
20
  customConfirmButton: {
16
21
  className: 'confirm',
17
22
  label: 'Proceed',
18
23
  },
19
24
  label: 'Do you want to initiate backup procedure?',
20
- }));
21
- const uiResp = await uiPromise.promise;
22
- return uiResp.payload;
25
+ };
23
26
  }
24
27
  async run() {
25
28
  const cmd = this.device.getCommands();
26
- const response = await cmd.typedCall('BackupDevice', 'Success');
29
+ const response = await cmd.typedCall('BackupDevice', 'Success', this.params);
27
30
  return response.message;
28
31
  }
29
32
  }
@@ -6,7 +6,6 @@ type Params = PROTO.BinanceGetAddress & {
6
6
  export default class BinanceGetAddress extends AbstractMethod<'binanceGetAddress', Params[]> {
7
7
  hasBundle?: boolean;
8
8
  progress: number;
9
- confirmed?: boolean;
10
9
  init(): void;
11
10
  get info(): string;
12
11
  getButtonRequestData(code: string): {
@@ -14,8 +13,10 @@ export default class BinanceGetAddress extends AbstractMethod<'binanceGetAddress
14
13
  serializedPath: string;
15
14
  address: string;
16
15
  } | undefined;
17
- confirmation(): Promise<boolean>;
18
- noBackupConfirmation(): Promise<boolean>;
16
+ get confirmation(): {
17
+ view: "export-address";
18
+ label: string;
19
+ } | undefined;
19
20
  _call({ address_n, show_display, chunkify }: Params): Promise<{
20
21
  address: string;
21
22
  }>;
@@ -15,6 +15,7 @@ class BinanceGetAddress extends AbstractMethod_1.AbstractMethod {
15
15
  this.progress = 0;
16
16
  }
17
17
  init() {
18
+ this.noBackupConfirmationMode = 'always';
18
19
  this.requiredPermissions = ['read'];
19
20
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('BNB'), this.firmwareRange);
20
21
  this.hasBundle = !!this.payload.bundle;
@@ -35,7 +36,6 @@ class BinanceGetAddress extends AbstractMethod_1.AbstractMethod {
35
36
  this.params.length === 1 &&
36
37
  typeof this.params[0].address === 'string' &&
37
38
  this.params[0].show_display;
38
- this.confirmed = useEventListener;
39
39
  this.useUi = !useEventListener;
40
40
  }
41
41
  get info() {
@@ -53,27 +53,13 @@ class BinanceGetAddress extends AbstractMethod_1.AbstractMethod {
53
53
  };
54
54
  }
55
55
  }
56
- async confirmation() {
57
- if (this.confirmed)
58
- return true;
59
- await this.getPopupPromise().promise;
60
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
61
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
62
- view: 'export-address',
63
- label: this.info,
64
- }));
65
- const uiResp = await uiPromise.promise;
66
- this.confirmed = uiResp.payload;
67
- return this.confirmed;
68
- }
69
- async noBackupConfirmation() {
70
- await this.getPopupPromise().promise;
71
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
72
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
73
- view: 'no-backup',
74
- }));
75
- const uiResp = await uiPromise.promise;
76
- return uiResp.payload;
56
+ get confirmation() {
57
+ return !this.useUi
58
+ ? undefined
59
+ : {
60
+ view: 'export-address',
61
+ label: this.info,
62
+ };
77
63
  }
78
64
  async _call({ address_n, show_display, chunkify }) {
79
65
  const cmd = this.device.getCommands();
@@ -2,10 +2,12 @@ import { AbstractMethod } from '../../../core/AbstractMethod';
2
2
  import type { PROTO } from '../../../constants';
3
3
  export default class BinanceGetPublicKey extends AbstractMethod<'binanceGetPublicKey', PROTO.BinanceGetPublicKey[]> {
4
4
  hasBundle?: boolean;
5
- confirmed?: boolean;
6
5
  init(): void;
7
6
  get info(): string;
8
- confirmation(): Promise<boolean>;
7
+ get confirmation(): {
8
+ view: "export-address";
9
+ label: string;
10
+ };
9
11
  run(): Promise<{
10
12
  path: number[];
11
13
  publicKey: string;
@@ -27,25 +27,13 @@ class BinanceGetPublicKey extends AbstractMethod_1.AbstractMethod {
27
27
  get info() {
28
28
  return 'Export Binance public key';
29
29
  }
30
- async confirmation() {
31
- if (this.confirmed)
32
- return true;
33
- await this.getPopupPromise().promise;
34
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
35
- let label;
36
- if (this.params.length > 1) {
37
- label = 'Export multiple Binance public keys';
38
- }
39
- else {
40
- label = `Export Binance public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`;
41
- }
42
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
30
+ get confirmation() {
31
+ return {
43
32
  view: 'export-address',
44
- label,
45
- }));
46
- const uiResp = await uiPromise.promise;
47
- this.confirmed = uiResp.payload;
48
- return this.confirmed;
33
+ label: this.params.length > 1
34
+ ? 'Export multiple Binance public keys'
35
+ : `Export Binance public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`,
36
+ };
49
37
  }
50
38
  async run() {
51
39
  const responses = [];
@@ -10,7 +10,7 @@ export default class BlockchainGetCurrentFiatRates extends AbstractMethod<'block
10
10
  init(): void;
11
11
  run(): Promise<{
12
12
  ts: number;
13
- rates: import("@trezor/blockchain-link-types/lib/common").FiatRatesLegacy;
13
+ rates: import("@trezor/blockchain-link-types/lib/common").FiatRatesBySymbol;
14
14
  }>;
15
15
  }
16
16
  export {};
@@ -12,7 +12,7 @@ export default class BlockchainGetFiatRatesForTimestamps extends AbstractMethod<
12
12
  run(): Promise<{
13
13
  tickers: {
14
14
  ts: number;
15
- rates: import("@trezor/blockchain-link-types/lib/common").FiatRatesLegacy;
15
+ rates: import("@trezor/blockchain-link-types/lib/common").FiatRatesBySymbol;
16
16
  }[];
17
17
  }>;
18
18
  }
@@ -6,7 +6,6 @@ type Params = PROTO.CardanoGetAddress & {
6
6
  export default class CardanoGetAddress extends AbstractMethod<'cardanoGetAddress', Params[]> {
7
7
  hasBundle?: boolean;
8
8
  progress: number;
9
- confirmed?: boolean;
10
9
  init(): void;
11
10
  get info(): string;
12
11
  getButtonRequestData(code: string): {
@@ -14,12 +13,13 @@ export default class CardanoGetAddress extends AbstractMethod<'cardanoGetAddress
14
13
  serializedPath: string;
15
14
  address: string;
16
15
  } | undefined;
17
- confirmation(): Promise<boolean>;
18
- noBackupConfirmation(): Promise<boolean>;
16
+ get confirmation(): {
17
+ view: "export-address";
18
+ label: string;
19
+ } | undefined;
19
20
  _call({ address_parameters, protocol_magic, network_id, derivation_type, show_display, chunkify, }: Params): Promise<{
20
21
  address: string;
21
22
  }>;
22
- _ensureFirmwareSupportsBatch(batch: Params): void;
23
23
  run(): Promise<import("../../../types").CardanoAddress | import("../../../types").CardanoAddress[]>;
24
24
  }
25
25
  export {};
@@ -16,6 +16,7 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
16
16
  this.progress = 0;
17
17
  }
18
18
  init() {
19
+ this.noBackupConfirmationMode = 'always';
19
20
  this.requiredPermissions = ['read'];
20
21
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Cardano'), this.firmwareRange);
21
22
  this.hasBundle = !!this.payload.bundle;
@@ -41,7 +42,6 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
41
42
  this.params.length === 1 &&
42
43
  typeof this.params[0].address === 'string' &&
43
44
  this.params[0].show_display;
44
- this.confirmed = useEventListener;
45
45
  this.useUi = !useEventListener;
46
46
  }
47
47
  get info() {
@@ -59,27 +59,13 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
59
59
  };
60
60
  }
61
61
  }
62
- async confirmation() {
63
- if (this.confirmed)
64
- return true;
65
- await this.getPopupPromise().promise;
66
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
67
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
68
- view: 'export-address',
69
- label: this.info,
70
- }));
71
- const uiResp = await uiPromise.promise;
72
- this.confirmed = uiResp.payload;
73
- return this.confirmed;
74
- }
75
- async noBackupConfirmation() {
76
- await this.getPopupPromise().promise;
77
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
78
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
79
- view: 'no-backup',
80
- }));
81
- const uiResp = await uiPromise.promise;
82
- return uiResp.payload;
62
+ get confirmation() {
63
+ return !this.useUi
64
+ ? undefined
65
+ : {
66
+ view: 'export-address',
67
+ label: this.info,
68
+ };
83
69
  }
84
70
  async _call({ address_parameters, protocol_magic, network_id, derivation_type, show_display, chunkify, }) {
85
71
  const cmd = this.device.getCommands();
@@ -93,27 +79,11 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
93
79
  });
94
80
  return response.message;
95
81
  }
96
- _ensureFirmwareSupportsBatch(batch) {
97
- const SCRIPT_ADDRESSES_TYPES = [
98
- constants_1.PROTO.CardanoAddressType.BASE_SCRIPT_KEY,
99
- constants_1.PROTO.CardanoAddressType.BASE_KEY_SCRIPT,
100
- constants_1.PROTO.CardanoAddressType.BASE_SCRIPT_SCRIPT,
101
- constants_1.PROTO.CardanoAddressType.POINTER_SCRIPT,
102
- constants_1.PROTO.CardanoAddressType.ENTERPRISE_SCRIPT,
103
- constants_1.PROTO.CardanoAddressType.REWARD_SCRIPT,
104
- ];
105
- if (SCRIPT_ADDRESSES_TYPES.includes(batch.address_parameters.address_type)) {
106
- if (!this.device.atLeast(['0', '2.4.3'])) {
107
- throw constants_1.ERRORS.TypedError('Method_InvalidParameter', `Address type not supported by device firmware`);
108
- }
109
- }
110
- }
111
82
  async run() {
112
83
  const responses = [];
113
84
  for (let i = 0; i < this.params.length; i++) {
114
85
  const batch = this.params[i];
115
- this._ensureFirmwareSupportsBatch(batch);
116
- batch.address_parameters = (0, cardanoAddressParameters_1.modifyAddressParametersForBackwardsCompatibility)(this.device, batch.address_parameters);
86
+ batch.address_parameters = (0, cardanoAddressParameters_1.modifyAddressParametersForBackwardsCompatibility)(batch.address_parameters);
117
87
  if (batch.show_display) {
118
88
  const silent = await this._call({
119
89
  ...batch,
@@ -5,11 +5,12 @@ interface Params extends PROTO.CardanoGetPublicKey {
5
5
  }
6
6
  export default class CardanoGetPublicKey extends AbstractMethod<'cardanoGetPublicKey', Params[]> {
7
7
  hasBundle?: boolean;
8
- confirmed?: boolean;
9
8
  init(): void;
10
9
  get info(): string;
11
- confirmation(): Promise<boolean>;
12
- noBackupConfirmation(allowSuppression?: boolean): Promise<boolean>;
10
+ get confirmation(): {
11
+ view: "export-xpub";
12
+ label: string;
13
+ };
13
14
  run(): Promise<import("../../../types").CardanoPublicKey | import("../../../types").CardanoPublicKey[]>;
14
15
  }
15
16
  export {};
@@ -29,42 +29,20 @@ class CardanoGetPublicKey extends AbstractMethod_1.AbstractMethod {
29
29
  suppress_backup_warning: batch.suppressBackupWarning,
30
30
  };
31
31
  });
32
+ this.noBackupConfirmationMode = this.params.every(batch => batch.suppressBackupWarning || !batch.show_display)
33
+ ? 'popup-only'
34
+ : 'always';
32
35
  }
33
36
  get info() {
34
37
  return 'Export Cardano public key';
35
38
  }
36
- async confirmation() {
37
- if (this.confirmed)
38
- return true;
39
- await this.getPopupPromise().promise;
40
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
41
- let label;
42
- if (this.params.length > 1) {
43
- label = 'Export multiple Cardano public keys';
44
- }
45
- else {
46
- label = `Export Cardano public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`;
47
- }
48
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
39
+ get confirmation() {
40
+ return {
49
41
  view: 'export-xpub',
50
- label,
51
- }));
52
- const uiResp = await uiPromise.promise;
53
- this.confirmed = uiResp.payload;
54
- return this.confirmed;
55
- }
56
- async noBackupConfirmation(allowSuppression) {
57
- if (allowSuppression &&
58
- this.params.every(batch => batch.suppressBackupWarning || !batch.show_display)) {
59
- return true;
60
- }
61
- await this.getPopupPromise().promise;
62
- const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
63
- this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
64
- view: 'no-backup',
65
- }));
66
- const uiResp = await uiPromise.promise;
67
- return uiResp.payload;
42
+ label: this.params.length > 1
43
+ ? 'Export multiple Cardano public keys'
44
+ : `Export Cardano public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`,
45
+ };
68
46
  }
69
47
  async run() {
70
48
  const responses = [];
@@ -5,19 +5,7 @@ import type { OutputWithData } from '../cardanoOutputs';
5
5
  import { PROTO } from '../../../constants';
6
6
  import { type CardanoSignedTxData } from '../../../types/api/cardano';
7
7
  import type { AssetGroupWithTokens } from '../cardanoTokenBundle';
8
- declare const CardanoSignTransactionFeatures: Readonly<{
9
- TransactionStreaming: string[];
10
- TokenMinting: string[];
11
- Multisig: string[];
12
- NetworkIdInTxBody: string[];
13
- OutputDatumHash: string[];
14
- ScriptDataHash: string[];
15
- Plutus: string[];
16
- KeyHashStakeCredential: string[];
17
- Babbage: string[];
18
- CIP36Registration: string[];
19
- CIP36RegistrationExternalPaymentAddress: string[];
20
- }>;
8
+ declare const CardanoSignTransactionFeatures: Readonly<{}>;
21
9
  export type CardanoSignTransactionParams = {
22
10
  signingMode: PROTO.CardanoTxSigningMode;
23
11
  inputsWithPath: InputWithPath[];